1
\$\begingroup\$

I am using an energia sketch to program my MSP430G2553 controller. I need to know how to use low-power mode. Do I leave the loop section of the sketch empty and set up an interrupt in the setup section? Or is there more to it than that? How do you turn low power mode on and off?

UPDATE: I've discovered 2 things regarding low power mode:

sleep() puts you into LPM3
sleepSeconds puts you into LPM3
suspend() puts you into LPM4
\$\endgroup\$
1
\$\begingroup\$

LPM modes are turned on by setting the appropriate bits in the status register:

_bis_SR_register(LPM1_bits);

Any LPM mode is automatically turned off when the CPU starts running an interrupt handler. (When the handler function returns, LPM is re-entered because the old SR value is restored from the stack.)

Interrupts should be setup in the setup() function. You can go to sleep at the end of the setup() function, or in the loop() function.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.