Hi all !
I'm having some trouble trying to make the timer of wolverine work. In fact, everytime TA1R reachs 65536, instead of getting back to 0, it makes the cpu resetting. I'm in continuous mode and here's my code (actually it's a part of the Contiki OS code) :
TA1CTL = TASSEL_1 | TACLR | ID_0; TA1CCTL1 = CCIE; TA1CCR1 = INTERVAL; TA1CTL |= MC_2;
And the interrupt handler :
#pragma vector = TIMER1_A1_VECTOR
__interrupt void Timer1_A1_ISR(void)
{
if(TA1IV == 2) {
while((TA1CTL & MC1) && TA1CCR1 - TA1R == 1);
do {
TA1CCR1 += INTERVAL;
++count;
if(count % CLOCK_CONF_SECOND == 0) {
++seconds;
}
} while((TA1CCR1 - TA1R) > INTERVAL);
last_tar = TA1R;
}
}
Thank you for your help,
Best regards,
Laurent.