Part Number: TMS320F2812
Hello,
In my project, I use an EV Timer. I want to stop (disable) it in an interrupt handler, e.g. XINT1_Handler.
That is,
XINT1_Handler {
...
// 1. Disable EV Timer using register;
EvaRegs.T1CON.all = 0x1200;
// 2. Clear EV IFR
EvaRegs.EVAIFRA.all = BIT7;
...
}
'1. EvaRegs.T1CON.all = 0x1200;' Stop the timer and the counter is HOLD according to datasheet 'SPRU065‘ and
'2. EvaRegs.EVAIFRA.all = BIT7;' Clear IFR for possible future interrupt.
The question is if there is a chance (though very small) that:
'EvaRegs.T1CON.all = 0x1200;' is called exactly when the timer counts to pre-defined max value (should give interrupt on next clock cycle according to'SPRU065‘), and then
’EvaRegs.EVAIFRA.all = BIT7;‘ is called (which allows future interrupt), and finally
The last interrupt is sent to PIE (and CPU), ALTHOUGH the timer has been stopped by me.
I want to avoid this situation. That is: when EV Timer is stopped, absolutely no future interrupt is issued until I turn it on again. But, is this possible?
PS: Mask the interrupt (IMR) is not a good idea because when you mask it out, the pending one (from last time) get serviced.
Thanks,
Guan