Hi: I am using the MSP430G2231 and trying to go into LPM3 with wakeup by TIMER A. To put it into LPM3 I am using these commands:
MOV.B #20h,&BCSCTL3 ;SELECT VLOCLK AS THE LOW-FREQUENCY CLOCK
BIS.W #4h,&TACTL ;RESET TIMER
MOV.W #110h,&TACTL ;TIMER CLOCK SOURCE: ACLK, UPMODE
MOV.W #0010h,&TACCTL0 ;COMPARE MODE; ENABLE INTERRUPT
MOV.W #6850,&TACCR0 ;COUNT UP VALUE (0.7 SEC. WITH 12 KHZ CLK)
BIC.B #30h,&BCSCTL1 ;MAKE SURE ACLK DIVIDE BY IS 1
BIS.W #00D8h,SR ;LPM3, VLOCLK ON, CPU OFF, MASKED INTERRUPTS ENABLED
NOP
Then when the processor is to wake up from the LPM3 I am using these commands:
INTERRUPT BIC.W #00F0h,0(SP) ;ON: SMCLK, DCO, OSCS, CPU
MOV.W #CONTINUE,2(SP)
RETI ;clear LPM3 mode
CONTINUE MOV.B #00h,&BCSCTL2 ;select DCO for MCLK, SMCLK, no dividers on MCLK or SMCLK, internal R's
Then at the end of the program the vectors for the wake up are as follows:
ORG 0FFF2h ;timer A interrupt
DC16 INTERRUPT
ORG 0FFFCh ;interrupt vector address
DC16 CONTINUE
ORG 0FFFEh ; MSP430 RESET Vector
DC16 RESET ;
END
It is not working. What am I doing wrong?
Thanks in advance for your help.
Mike.