Texas Instruments MSP430x4xx Computer Hardware User Manual


 
Operating Modes
2-15System Resets, Interrupts, and Operating Modes
2.3.1 Entering and Exiting Low-Power Modes
An enabled interrupt event wakes the MSP430 from any of the low-power
operating modes. The program flow is:
- Enter interrupt service routine:
J The PC and SR are stored on the stack
J The CPUOFF, SCG1, and OSCOFF bits are automatically reset
- Options for returning from the interrupt service routine:
J The original SR is popped from the stack, restoring the previous
operating mode.
J The SR bits stored on the stack can be modified within the interrupt
service routine returning to a different operating mode when the RETI
instruction is executed.
; Enter LPM0 Example
BIS #GIE+CPUOFF,SR ; Enter LPM0
; ... ; Program stops here
;
; Exit LPM0 Interrupt Service Routine
BIC #CPUOFF,0(SP) ; Exit LPM0 on RETI
RETI
; Enter LPM3 Example
BIS #GIE+CPUOFF+SCG1+SCG0,SR ; Enter LPM3
; ... ; Program stops here
;
; Exit LPM3 Interrupt Service Routine
BIC #CPUOFF+SCG1+SCG0,0(SP) ; Exit LPM3 on RETI
RETI
Extended Time in Low-Power Modes
The negative temperature coefficient of the DCO should be considered when
the DCO is disabled for extended low-power mode periods. If the temperature
changes significantly, the DCO frequency at wake-up may be significantly
different from when the low-power mode was entered and may be out of the
specified operating range. To avoid this, the DCO can be set to it lowest value
before entering the low-power mode for extended periods of time where
temperature can change.
; Enter LPM4 Example with lowest DCO Setting
BIC.B #FN_8+FN_4+FN_3+FN_2,&SCFI0 ; Lowest Range
MOV.B #010h,&SCFI1 ; Select Tap 2
BIS #GIE+CPUOFF+OSCOFF+SCG1+SCG0,SR ; Enter LPM4
; ... ; Program stops
; Interrupt Service Routine
BIC #CPUOFF+OSCOFF+SCG1+SCG0,0(SR); Exit LPM4 on RETI
RETI