This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CBC Trip Zone with 2 comparators - 28069

Hello,

I want to use 2 comparators to set the CBC trip on my epwm. I used

I configured the comparators :

  • GpioCtrlRegs.AIOMUX1.bit.AIO2 = 2;    // Configure AIO2 for CMP1A (analog input) operation
    Comp1Regs.COMPCTL.bit.COMPSOURCE = 0;
    Comp1Regs.COMPCTL.bit.CMPINV = 0;
    Comp1Regs.COMPCTL.bit.COMPDACEN = 1;
    Comp1Regs.COMPCTL.bit.SYNCSEL = 0;        //Comp2Regs.COMPCTL.bit.QUALSEL = 0;
    Comp1Regs.DACVAL.bit.DACVAL = (int)(p_Debug2);
  •  GpioCtrlRegs.AIOMUX1.bit.AIO4 = 2;    // Configure AIO4 for CMP2A (analog input) operation
    Comp2Regs.COMPCTL.bit.COMPSOURCE = 0;
    Comp2Regs.COMPCTL.bit.CMPINV = 0;
    Comp2Regs.COMPCTL.bit.COMPDACEN = 1;
    Comp2Regs.COMPCTL.bit.SYNCSEL = 0;        //Comp2Regs.COMPCTL.bit.QUALSEL = 0;
    Comp2Regs.DACVAL.bit.DACVAL = (int)(p_Debug3);

and then i configured the trip zone peripherals:

  • EPwm2Regs.DCTRIPSEL.bit.DCAHCOMPSEL = DC_COMP2OUT;   
    EPwm2Regs.TZDCSEL.bit.DCAEVT2 = TZ_DCAH_HI;                                                       
    EPwm2Regs.DCACTL.bit.EVT2SRCSEL = DC_EVT2;          
    EPwm2Regs.DCACTL.bit.EVT2FRCSYNCSEL = DC_EVT_ASYNC;
    EPwm2Regs.TZSEL.bit.DCAEVT2 = 1;                    
    EPwm2Regs.TZCTL.bit.TZA = TZ_FORCE_LO;   
  • EPwm2Regs.DCTRIPSEL.bit.DCBHCOMPSEL = DC_COMP1OUT;  
    EPwm2Regs.TZDCSEL.bit.DCBEVT2 = TZ_DCBH_HI;                                             
    EPwm2Regs.DCBCTL.bit.EVT2SRCSEL = DC_EVT2;            
    EPwm2Regs.DCBCTL.bit.EVT2FRCSYNCSEL = DC_EVT_ASYNC;
    EPwm2Regs.TZSEL.bit.DCBEVT2 = 1;                 
    EPwm2Regs.TZCTL.bit.TZB = TZ_FORCE_LO;    

But I have only COMP2 working, not COMP1.

Am I making some mistake or it is not possible to use 2 comparators to set trip on one epwm?

Thank you.