Hi, there. I'm currently using F28069 and using the interrupt of ECAP2 which serves in APWM mode. I have enabled the interrupt when CTR reaches CMP and here is my interrupt service function
__interrupt void ecap2_isr(void){
GpioDataRegs.GPATOGGLE.bit.GPIO0 = 1;
ECap2Regs.ECCLR.bit.INT = 1;
ECap2Regs.ECCLR.bit.CTR_EQ_CMP = 1;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP4;
}
I expected to see a pulsed waveform whose duty is approximately 50% and frequence is half of the APWM. But actually, when I ran the program, I found the duty is very small (close to 0) and the frequency is the same as APWM. So I think probably there is some problem with my interrupt flag clearing process and it triggers the interrupt function being operated two times in each APWM cycle.
After that, I have made a modification. I change the order of two lines of the code above ,which is shown below
__interrupt void ecap2_isr(void){
GpioDataRegs.GPATOGGLE.bit.GPIO0 = 1;
ECap2Regs.ECCLR.bit.CTR_EQ_CMP = 1;
ECap2Regs.ECCLR.bit.INT = 1;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP4;
}
And the waveform turned to be the same as I expected. But I have no idea about this phenomenon, could you please give me some information related to this weird thing? Thank you.

