
Principles for Low-Power Applications
The program flow for entering LPMx.5 is:
1. Configure I/O appropriately. See the
chapter for complete details on configuring I/O for
LPMx.5.
(a) Set all ports to general-purpose I/O.
(b) Configure each port to make sure that there are no floating inputs, based on the application
requirements.
(c) If wakeup from I/O is desired, appropriately configure input ports with interrupt capability.
2. If LPM3.5 is available and desired, enable RTC operation. In addition, configure any RTC interrupts if
desired for LPM3.5 wakeup event. See the
chapter for complete details.
3. Enter LPMx.5. The following code example shows how to enter LPMx.5 mode. See the
chapter for further details.
; Enter LPMx.5 Example
MOV.B #PMMPW_H, &PMMCTL0_H
; Open PMM registers for write
BIS.B #PMMREGOFF, &PMMCTL0_L
;
BIS
#GIE+SCG1+SCG0,SR
; Enter LPMx.5 when PMMREGOFF is set.
Exit from LPMx.5 is possible with a RST event, a power-on cycle, or via specific I/O. Any exit from LPMx.5
causes a BOR. Program execution continues at the location stored in the system reset vector location
(0FFFEh) after execution of the boot code. The PMMLPM5IFG bit inside the PMM module is set,
indicating that the device was in LPMx.5 prior to the wakeup event. Additionally, SYSRSTIV = 08h, which
can be used to generate an efficient reset handler routine. During LPMx.5, all I/O pin conditions are
automatically locked to the current state. Upon exit from LPMx.5, the I/O pin conditions remain locked until
the application unlocks them. See the
chapter for complete details. If LPM3.5 was in effect,
RTC operation continues uninterrupted upon wakeup. The program flow for exiting LPMx.5 is:
1. Enter system reset service routine
(a) Reconfigure system as required for the application.
(b) Reconfigure I/O as required for the application.
(c) Unlock system by clearing LOCKLPM5 bit in PM5CTL0.
1.5
Principles for Low-Power Applications
Often, the most important factor for reducing power consumption is using the device clock system to
maximize the time in LPM3 or LPM4 modes whenever possible.
•
Use interrupts to wake the processor and control program flow.
•
Peripherals should be switched on only when needed.
•
Use low-power integrated peripheral modules in place of software driven functions. For example,
Timer_A and Timer_B can automatically generate PWM and capture external timing with no CPU
resources.
•
Calculated branching and fast table look-ups should be used in place of flag polling and long software
calculations.
•
Avoid frequent subroutine and function calls due to overhead.
•
For longer software routines, single-cycle CPU registers should be used.
If the application has low duty cycle and slow response time events, maximizing time in LPMx.5 can
further reduce power consumption significantly.
39
SLAU272C – May 2011 – Revised November 2013
System Resets, Interrupts, and Operating Modes, System Control Module
(SYS)
Copyright © 2011–2013, Texas Instruments Incorporated