Hi,
I wrote following code. I set 0.5 sec timer in up mode in timer_a function. & then send it in LMP0 mode. Now instead of counting upto TACCR0 value, then go into ISR, CPU after entering LPM0 mode at once enters into ISR. I don't understand why.
Kindly help.
void timer_a(void)
{
TACCTL0=CCIE; //enable CCIE interrupt
TACCR0=0xff00; //count upto this value
TACTL=TASSEL_2 + ID_0 +MC_1; //// set timer 0 as SMCLK, ID-8, MC-2,taie-1
__bis_SR_register(CPUOFF + GIE); // LPM0, ADC10_ISR will force exit (LPM0 MODE)
P1OUT=0x00;
}
#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A (void)
{
__bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR)
}
Regards
Deepak Bansal

