Hi there,
I'm using the rf430frl152h. Basically I'm toggeling an LED by using the timer function. Switching into LPM0 works properly. If I try to switch into LPM3, it only jumps ones into the ISR and than stops in the main at the line "__bis_SR_register(LPM3_bits+GIE);"
So what problem do I have with the LPM3 which I don't have in the LPM0?
Following the code (yellow: initializations, green: main routine, blue: ISR of TIMER_A0
void DeviceInit(void)
{
CCSCTL0 = CCSKEY; // Unlock CCS
CCSCTL1 = 0; // do not half the clock speed
CCSCTL4 = SELA__LFCLK + SELM__HFCLK + SELS__HFCLK; // Select VLO for ACLK and select HFCLK/DCO for MCLK, and SMCLK
CCSCTL5 = DIVA__2 + DIVM__1 + DIVS__1; // Set the Dividers for ACLK (4), MCLK, and SMCLK to 1
CCSCTL6 = XTOFF; // Turns of the crystal if it is not being used
CCSCTL8 = ACLKREQEN + MCLKREQEN + SMCLKREQEN; //disable clocks if they are not being used
CCSCTL0_H |= 0xFF; // Lock CCS
TA0CCTL0 |= CCIE;
TA0CTL |= TASSEL_1 + MC_1 + ID_3;
TA0CCR0 = 20000;
return;
}
void main()
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog
DeviceInit();
__bis_SR_register(LPM3_bits+GIE);
while(1)
{
}
}
#pragma vector = TIMER0_A0_VECTOR
__interrupt void TimerA0_ISR(void)
{
if(TA0CCR0 == TA0_LED_ON)
{
P1OUT &= ~(BIT1);
TA0CCR0 = TA0_LED_OFF;
}
else
{
P1OUT |= (BIT1);
TA0CCR0 = TA0_LED_ON;
}
__bis_SR_register_on_exit(LPM3_bits+GIE);
}
Thx for any help!!
Regards Nik

