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!