2

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
Curtis
  • 341
  • 6
  • 18

1 Answers1

1

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.

CL.
  • 18,161
  • 5
  • 40
  • 67