I'm already using the trip zone submodule (coupled with the analog comparators) to shut down (OSHT) the system (and it works fine). I am trying to add an additional OSHT event using software, but it doesn't seem to be working. I copied the relevant code snippets below for your reference. Any ideas?
(in the main interrupt loop)
// Overvoltage Protection via software
if (Vabsense > 600)
{
EALLOW;
EPwm1Regs.TZFRC.bit.OST = 1;
EPwm2Regs.TZFRC.bit.OST = 1;
EDIS;
}
else {}
(ePWMx initialization)
// Set Trip Zone Submodule
EPwm1Regs.TZSEL.bit.DCAEVT1 = 1; // Enable DCAEVT1 as one-shot trip source
EPwm1Regs.TZSEL.bit.DCBEVT1 = 1; // Enable DCBEVT1 as one-shot trip source
EPwm1Regs.TZCTL.bit.DCAEVT1 = 2; // 2 = force EPwmxA low
EPwm1Regs.TZCTL.bit.DCBEVT1 = 2; // 2 = force EPwmxB low
EPwm1Regs.TZEINT.bit.OST = 1; // any one-shot trip event generates a TX interrupt
// Digital Compare Submodule (EALLOW protected)
EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL = 8; //COMP1OUT is input to DCAH
EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL = 8; //COMP1OUT is input to DCBH
EPwm1Regs.TZDCSEL.bit.DCAEVT1 = 2; //if DCAH goes Hi, event generated
EPwm1Regs.TZDCSEL.bit.DCBEVT1 = 2; //if DCBH goes Hi, event generated