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.

TMS320F28069: right order to Clear Capture Interrupt

Part Number: TMS320F28069


Hi expert,

I have a customer using F28069. They found if they clear CAP interrupt in different order, it will face different result.

and they want to know the reason.

ECAP is configure as both rising edge and falling edge triggered. And is absolute counting mode.

every time the code run into the capture ISR, a GPIO will toggle. And it also change the triggered edge.

At the end of the capture ISR, customer find there will be different phenomenon if they clear the interrupt flag in different order.

interrupt void zerocrossingISR(void)
{
//customer interrupt function includes change the capture polarity
ECap2Regs.ECCLR.bit.CTROVF=1;
ECap2Regs.ECCLR.bit.INT=1;//if put here, the capture waveform is abnormal
ECap2Regs ECCLR.bit.CEVT1=1;
ECap2Regs.ECCTL2.bit.REARM=1;
ECap2Regs.ECCLR.bit.INT=1;//if put here, the capture waveform is normal
PieCtrlRegs.PIEACK.all=PIEACK_GROUP4;
}

This is normal waveform:

Yellow: Grid voltage which is the input of the capture module.

Green: GPIO which will toggles every time the code run into the capture ISR.

This is abnormal waveform and its zoom in.

BR

Emma