Hello,
in my project I'm using an RM48 and I have to reset the RTI counter when an external interrupt occurred. So I perform the follow istruction (using the HALCoGen generated code):
rtiStopCounter(rtiCOUNTER_BLOCK1);
while(!rtiResetCounter(rtiCOUNTER_BLOCK1));
rtiSetPeriod(rtiCOMPARE1, Period);
rtiStartCounter(rtiCOUNTER_BLOCK1);
The problem is that the free running counter is set to 0 (and the compare register rtiREG1->CMP[compare].UDCPx to the period time), but the Comp1 register remains to the old value. This means that when no external interrupt occurres the the RTI counter match the compare in a very long time corresponding to Comp1.
How can I do to Reset the RTI counter???
Thanks in advance,
Antonio