I have a TMS320F28035-based motor control board and following code for fault trip when PWMs is low
void B1(void) // Toggle GPIO-00
//----------------------------------------
{
if(EPwm1Regs.TZFLG.bit.OST == 0x1) // TripZ for PWMs is low (fault trip)
{
TripFlagDMC=1;
GpioDataRegs.GPBTOGGLE.bit.GPIO42 = 1;
}
GpioDataRegs.GPBTOGGLE.bit.GPIO34 = 1; // Turn on/off LD3 on the controlCARD
//-----------------
//the next time CpuTimer1 'counter' reaches Period value go to B2
B_Task_Ptr = &B2;
//-----------------
}
After the TZFLG is tripggered, I was trying to clear the flag, but once I clear it, it will automatically come back until I reset the power. Is there any other way to clear the flag by re-initializing some parameter instead of reset the chip?