I am using a Piccolo TMS28035 for a standard 3-phase brushless DC drive. To achieve current limit, I have configured the comparators to open both the upper and the lower whenever current limit is exceeded. I have my trip zone configured as such (with the other two phases essentially in redundant configuration.
//trip-zone conditions
//make comparator 1 triggers for ePWM1 A & B events
EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL = 8; //DCAH input select -> (COMP1OUT)
EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL = 8; //DCBH input select -> (COMP1OUT)
//trigger digital compare event 2 for ePWM1 A and B when COMP1OUT goes HIGH
EPwm1Regs.TZDCSEL.bit.DCAEVT2 = 2; //DCAEVT2 -> (DCAH = high, DCAL = don't care)
EPwm1Regs.TZDCSEL.bit.DCBEVT2 = 2; //DCBEVT2 -> (DCBH = high, DCBL = don't care)
EPwm1Regs.DCACTL.bit.EVT2FRCSYNCSEL = 1; //event A source is asynchronous
EPwm1Regs.DCBCTL.bit.EVT2FRCSYNCSEL = 1; //event B source is asynchronous
//make events A and B cycle by cycle (DCxEVT1 - one shot/DCxEVT2 - CBC)
EPwm1Regs.TZSEL.bit.DCAEVT2 = 1; //enable DCAEVT2 as a CBC trip source
EPwm1Regs.TZSEL.bit.DCBEVT2 = 1; //enable DCBEVT2 as a CBC trip source
//force ePWM outputs A and B to the desired state on event trigger
EPwm1Regs.TZCTL.bit.DCAEVT2 = 2; //force ePWM1A to a LOW state
EPwm1Regs.TZCTL.bit.DCBEVT2 = 1; //force ePWM1B to a HIGH state
Based on the register settings, the ePWM1A should go LOW and ePWM1B should go HIGH whenever the output of comparator 1 goes HIGH. However, it appears that the ePWM1 outputs simply go to high impedance when the comparator is activated. Regardless of what I set DCAEVT2 and DCBEVT2 to, the result was always the same. After debugging for some time I tried setting some of the other bits in the TZCTL register and found that changing the last two lines of code to
EPwm1Regs.TZCTL.bit.TZA = 2;
EPwm1Regs.TZCTL.bit.TZB = 1;
gave me the results I wanted (i.e. ePWM1A = LOW and ePWM1B = HIGH). Am I missing something here or are TZA and TZB in the TZCTL register actually controlling DCAEVT2 and DCBEVT2? I also verified all the register values in debug mode so I know they weren't being changed somewhere else in my code.