Hi,
I'm using software modules for motor control on several C2000 CPUs for year now with a "standard" timing structure:
-high prio ISR (on ePWM1 interrupt) for motor control
-low prio ISR (done with counter in high prio ISR) for error handling
-main loop (for communication)
Now I added another ISR (on ePWM4 interrupt) in a certain project. This should be interrupted by the high speed ISR. Code goes like:
interrupt void epwm4_isr(void)
{
// allow higher priority interrupts
EINT;
IER |= M_INT3; // reenable this group (otherwise only done in HW after leaving this ISR!)
// Acknowledge this interrupt to receive more interrupts from group 3
PieCtrlRegs.PIEACK.all = PIEACK_GROUP3;
// a few line of actual code...
foo();
// Clear INT flag for this timer
EPwm4Regs.ETCLR.bit.INT = 1;
}
This usually works, but sometimes (and of course not reproducible) my high prio epwm1 ISR gets into a timing overflow (this check is done with CPU timer 0). Is there something wrong with handling of the int flag in this case where two int sources of the same group are active?
Thank you,
Ralph