Electronic – Waking Up From Deep Sleep Modes

avrlow-powermicrocontrollermsp430

Most microcontrollers (e.g. AVRs,MSP430s, PICs, etc) support a number of different sleep modes. The "deepest" sleep mode is the one that purports the lowest power draw (e.g. "Power Down", "Shut Down"), but all the clock systems are typically halted in these modes and it seems to me that the only way to "wake up" from them is via external stimulus (e.g. pin change interrupts, chip reset). Am I missing something? Are there awesomely low power methods of generating a periodic wakeup signal for an MCU?

Assuming my goal is to minimize power consumption (i.e. sleep deeply for as long as possible, stay awake as briefly as possible), while periodically waking up to execute a function, what's the common way to achieve this type of behavior? To further simplify matters, lets assume that my function is stateless (I don't have to remember anything from the past to perform it).

I've had some success using the WDT on the MSP430 to get this effect. I just made my main routine be my function, with the last line enabling the watchdog timer to expire after a certain period and going into LPM4.5 or whatever the "deep sleep" mode is called. The net result is the function is performed, the MCU sleeps, the WDT expires, and the chip resets, ad nauseum. Seems to work, just wondering if there is a "better" or "more elegant" or "more power efficient" way of getting this type of behavior?

I haven't tried this approach with an AVR yet, but I think the WDT is more "power hungry" in the AVRs than on the MSP430 so it may be less attractive for low power work. Perhaps there is not a "universal" approach to low power, and you have to use the tools afforded by a given product line? I know the new picoPower line has lots of whiz-bang features like the Event System and Sleep Walking that in some cases hardly require the CPU to be awake at all if you can make your application fit into that structure…

OK enough of my wandering, lets here what ya'll have to say 🙂

Edit
Concrete examples illustrating techniques would also be cool!

Best Answer

Most micros support a low-power 32.768 kHz watch crystal oscillator with some kind of prescaler and timer interrupt. Set the prescaler so the timer is counting slowly and the interrupt happens at the period you desire.

Some micros also have a built-in low-power RC timer if exact timing isn't critical.

The datasheet for any low-power micro will list the power with 32.768 oscillator (and nothing else) running. It's pretty close to zero. You can do the math to see if this is acceptable, and compare it to the current drawn by the watchdog.

OK, for example on the msp430f2013, let's look at power in the datasheet.

0.5 μA is almost zero, although it is five times the true OFF mode.

For more detail, we can look inside the datasheet.
Going from LPM4 (everything off) to LPM3 (running the oscillator) is the difference between 0.5 μA and 1 μA.

Suppose the battery is CR2032 with 225 mAh capacity. Then standby in LPM4 is about 50 years and in LPM3 is about 25 years. 25 years is long enough for many applications, because the ON-current (during the measurement itself) dominates the consumption.

alt text