Energy-efficient MCUs (cont.)
A kind of ‘mezzanine’ state above EM4 preserves a few more critical functions, in particular the real-time clock and 512 bytes of backup memory. Drawing only 400nA, this state would consume the capacity of a pair of AA cells in roughly seven years. Although intended primarily for use in the event of power supply failure, it can be an excellent alternative when RTC and a faster wake-up time are desirable.
With more functionality still, the ‘stop’ mode (EM3 in Figure 3) enables a limited degree of autonomous peripheral activity and faster wake-up. Here, the high- and low-frequency oscillators are disabled, but the MCU’s full RAM and configuration register states are preserved. In addition to the elements active in EM4, the power-on reset and brown-out detector are active, and the CPU can be woken up by an asynchronous external interrupt or via a number of internal sources, such as the device’s analogue comparators (ACMP) and pulse counter (PCNT).
For a designer, the key specifications to note in this mode are the time to wake up – which should be of the order of a few microseconds – and the absolute power consumption (10 to 30µA for a typical MCU, 590nA for a best-in-class device such as the EFM32). Perhaps the most important point for the designer to remember is that some MCUs do not include full internal memory retention in this mode.
The deep sleep mode (EM2 in Figure 3) leaves all of the MCU’s critical elements active, while disabling high frequency system clocks and other non-essential loads. In addition to the EM3 functionality, the 32 kHz oscillator used to clock on-chip peripherals remains active. This allows selected low-energy functions including the RTC, watchdog timer, and some external interfaces to remain active.
As in EM3, the designer needs to take care, since not every MCU series provides full register and RAM retention. Choosing a device with this capability allows the device to return to active state and resume program execution quickly. Best-in-class figures for current draw in this mode can be as low as 900nA (with RTC running from a precise clock source) [see footnote], with time to return to active mode of as little as 2µs.
Finally, in sleep/standby mode (EM1), the MCU’s pointer and configuration register states are fully preserved, eliminating the need to save them on power-down, and restore them on power-up. This typically saves hundreds to thousands of instruction cycles for each wake-up. The high-frequency oscillator remains active with the CPU clock tree disconnected, allowing the device to resume execution on the next clock cycle after a wake-up event. High-frequency peripherals (for instance direct memory access (DMA), analogue/digital and digital/analogue converters (ADC/DAC) and hardware encryption) remain active. Sleep mode current draw ranges from 45µA/MHz to 200µA/MHz, depending on the choice of MCU.
The process of selecting an MCU and the correct mode of operation for the application is relatively straightforward once these typical sleep mode specifications are understood. The designer first needs to list all of the alert, alarm and interrupt conditions within the application, and identify the one that requires the fastest response. For instance, in a logistics application, a device may perform both GPS-based location reporting and shock and vibration monitoring. The first has a wake-up tolerance that is measured in seconds; but when the MCU’s accelerometer inputs exceed pre-set threshold levels, the device will need to wake up and start measuring and recording within a millisecond or less.
The second step is to quantify the exact wake-up time from each sleep mode in the application that is required. This includes not just the time taken to return to a ready state, but also the time needed to execute the code that services the event in question. Executing an interrupt service routine, for instance, will take longer than jumping straight to a block of code dedicated to the specific event. Comparing the maximum tolerable delays with the minimum attainable service time figures will identify the appropriate sleep mode.
Finally, it is necessary to verify that the sleep mode selected has the appropriate resources: for instance RTC or fast ADC/DAC functionality. But what if the selected sleep mode still does not provide the required battery life?
The emergence of low-energy MCUs has provided a number of tools that address this question. Modern MCUs often include on-chip peripherals which can function without CPU intervention. In particular, monitoring analogue and digital alarm thresholds without CPU intervention enables the designer to wake the system up without the overhead of interrupt-driven techniques.
The Gecko architecture takes this approach one step further with a ‘peripheral reflex’ system. This allows peripherals to be interconnected without CPU intervention, allowing the designer to create quite complex state-machine type structures that can monitor outside events while the CPU is inactive. EFM32 processors also include a sensor interface called LESENSE, which allows autonomous monitoring of up to 16 external analogue sensors, including capacitive and resistive touch pads, and the inductive rotation sensors commonly used in metering products, all while the CPU remains in deep sleep mode.
Finally, it is worth remembering once again that energy is ‘power times time’. In many cases, the processor speed that results in the lowest overall energy use may not be the slowest clock speed. Since total energy is the sum of both static and active energy consumption, it may be that increasing the clock frequency, thereby reducing the amount of time the processor spends in active mode is the most energy-efficient strategy (Figure 4).
Figure 4. Using a faster clock speed to reduce an MCU’s
execution times can reduce its overall power consumption.
Figure 5: This annotated block diagram of an EFM32 MCU
illustrates how many of its peripherals remain available
in each of its low-power modes (Click Here to see
a larger, more detailed version of this image).
The pressure to achieve energy efficiency in designs has never been greater. Fortunately, the manufacturers of today’s MCUs are providing ever-richer feature sets that allow a balance between real-time responsiveness and energy efficiency. Equipped with this new generation of microcontrollers, creating new types of energy efficient products has never been easier.
About the author
- Stand-by current for the EFM32 in Deep Sleep (EM2) mode was measured under the following conditions: Power supply = 3V, Ambient temperature = 25 degrees C.
- Typical operating current was measured for the complete microcontroller and any external oscillators, including the RTC (running on the internal precision oscillator), with brown-out detection, full RAM and register retention active.
- Current in Deep Sleep (EM2) RTC mode was measured with the RTC running from the internal 32 kHz low-frequency oscillator.
Jo Stein Haugen is an Application Engineer at Energy Micro
, supporting customers, developing energy-friendly code examples, and writing application notes.
Before joining Energy Micro, Jo Stein worked with high-speed digital design, regulatory issues relating to short-range radio devices, and medical ultrasound imaging.
Jo Stein holds a Master's Degree in radio communications from The Norwegian University of Science and Technology (NTNU) in Trondheim, Norway.
If you found this article to be interest, visit Microcontroller / MCU Designline
where – in addition to my Max's Cool Beans
blogs on all sorts of "stuff" – you will find the latest and greatest design, technology, product, and news articles with regard to all aspects of designing and using microcontrollers.
Also, you can obtain a highlights update delivered directly to your inbox by signing up for my weekly newsletter – just Click Here
to request this newsletter using the Manage Newsletters tab (if you aren't already a member you'll be asked to register, but it's free and painless so don't let that stop you [grin]).
Last but certainly not least, make sure you check out all of the discussions and other information resources at All Programmable Planet
. For example, in addition to blogs by yours truly, microcontroller expert Duane Benson is learning how to use FPGAs to augment (sometimes replace) the MCUs in his robot (and other) projects.