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.
Hi expert,
On F280049, my customer use CMPSS6 as a source for EPWM7's DCAEVT1 and DCBEVT1. Further more DCAEVT1 and DCBEVT1 will One-shot trip EPWM7 with both channel in high state. They clear trip zone flag (TZFLG) in a 40KHz control loop. In the control loop, they check bit DCAEVT1 and DCBEVT1 of TZCLR register for EPWM7 module and clear flag like this:
const bool level2_ov_tz = (EPwm7Regs.TZCLR.all & DCAEVT1_MASK) ? true : false; ……… ……… ……… if(level2_ov_tz) { EALLOW; EPwm1Regs.TZCLR.all = EPwm1Regs.TZFLG.all; EPwm2Regs.TZCLR.all = EPwm2Regs.TZFLG.all; EPwm3Regs.TZCLR.all = EPwm3Regs.TZFLG.all; EPwm4Regs.TZCLR.all = EPwm4Regs.TZFLG.all; EPwm5Regs.TZCLR.all = EPwm5Regs.TZFLG.all; EPwm6Regs.TZCLR.all = EPwm6Regs.TZFLG.all; EPwm7Regs.TZCLR.all = EPwm7Regs.TZFLG.all; EDIS; } ………… ………… …………
But, they find sometime EPWM was get trip with a register reading of TZFLG = 4 which is unexpected. After they changed to clear the TZCLR in bit, the problem never occurs again. Could you help me find the possible cause? May be it is something related the signal delay?
Thanks
Sheldon
Sheldon,
As far as the FLAG, we dont document any difference in which one gets set first when it comes to TZFLG and TZOSTFLG. But I have always cleared TZOSTFLG first then the TZFLG. That is because you check TZFLG to see if there is an interrupt, then use TZOSTFLG to see which oneshot caused the interrupt if it was OST that caused it, clear the specific OST that caused it. Then clear the TZFLG for OST to complete the steps.
As far as the .all and the .bit difference, I have asked the team and I currently dont have an answer for you that is certain so we have to do more digging. Here is what we need to do.
Log all the flags before clearing.
Log all the flags after clearing.
See if they got cleared.
Log all the flags again.
And lets see what we have.
Plus, lets look at the disassembly for using the bit vs using the .all and see the difference is.