How to assess real-world MCU energy efficiency Battery-powered or self-powered smart sensor devices require a design which cuts power consumption to the bone. These types of devices must appear to be “always on,” but in practice must be designed to be “almost always off” for the application to operate within power-supply limitations. The proportion of time the system can be turned off depends on the purpose of the sensor. A heart-rate sensor could require sampling at 50Hz to capture accurate pulse readings, while a temperature sensor in a domestic smart thermostat might only need sampling once every second. The duty cycle can also vary depending on the application’s current state. A wearable device might turn off almost all sensors when inactive, maybe sampling an accelerometer once a second to check for activity. Upon detecting motion, the sample rate may increase to track the activity accurately. The microcontroller (MCU) at the heart of the system is rarely turned completely off, as it must manage a multitude of functions including coordinating the power-management modes of other components, as figure 1 illustrates. Figure 1. The MCU controls all devices in the application. The MCU must maximise its use of sleep modes while still performing all required tasks. The difference between active and sleep modes can easily range from single or double-digit milliamps in active mode, as shown in Figure 2, to below one microamp in sleep modes. To put this into perspective, many smart watches have small batteries with about 200mAh capacity. If the MCU alone consumed 10mA on average the battery would last for 20 hours. State-of-the-art MCUs have useful sleep modes going down to 1µA and below, which can significantly reduce average current consumption. If the average MCU current could be cut to 100µA through careful duty-cycling, as shown in figure 3, the battery could be made to last about eight days. A true low-power MCU has multiple sleep modes that enable meaningful application functions to continue without fully waking, or at least to wake quickly and perform the required task before returning immediately to sleep mode. Lighter sleep modes that simply gate the CPU clock off can deliver worthwhile power savings by reducing current from, say, several milliamps to below one milliamp, while enabling almost instantaneous wake-up. Figure 2. Continuous operation in active mode can result in short battery lifetime. All other functionality can remain available, as long as the peripherals are sufficiently autonomous and there is a DMA engine or similar MCU feature that can feed peripherals with data. Greater savings can be achieved by maximising use of the deeper MCU sleep modes. However, every time the MCU must perform a function not supported in deep-sleep mode, it must wake and therefore consume multiple milliamps. Unfortunately, MCU datasheets often present best-case figures based on configurations less likely to be viable in real-world applications. An excellent sleep current is not useful if the application must always re-enter active mode to perform its duties. Without access to comprehensive, independent and verifiable figures for energy consumption, developers must delve deeply into datasheets to assess the MCU accurately. Even then, comparing the sleep modes implemented by different MCU manufacturers can be impossible. Moreover, details about the effects of sleep modes on specific parts of the circuit may be missing. Often, the only option is to measure consumption empirically under real-world conditions. This effort becomes onerous if a developer is evaluating multiple MCUs. Recognising the need for objective, independent low-energy MCU benchmarking, the EEMBC has released Phase 1 of its ultra-low power ULPBench. This primarily addresses power used by the CPU core in active mode and the real-time clock (RTC) in sleep mode. However, MCUs sometimes need to support autonomous peripherals while sleeping. To address some of these aspects, ULPBench Phase 2 will focus on some common peripheral usages in sleep modes. Greater power savings can be achieved by turning off various peripherals to bring the current down to a few microamps or hundreds of nanoamps. Deep-sleep modes that keep only essential peripherals active to maintain a usable level of functionality are able to save the most energy. Some MCU functions, such as the brown-out detector (BOD), are not directly involved in executing an application, but should still always be enabled in deep-sleep modes. The BOD is needed to ensure reliable functionality or safe shutdown if power is interrupted or falls below the minimum required voltage for long enough to corrupt the MCU. Without the BOD, the corrupted MCU will continue operating with undefined behaviour. Figure 3. MCU sleep modes can significantly reduce average current consumption. Other peripherals that are critical to application functionality and must remain active include the RTC, as well as those needed for functions such as monitoring sensors and capacitive touch buttons or waiting for commands via a UART. This can require supporting circuitry such as oscillators, regulators, bias circuits and digital logic to remain available while in deep sleep. Asynchronous behaviour is also important to enable rapid response to external events even in deep-sleep modes. Since only lower frequency clocks are usually available in these modes, any clock-dependent peripherals will have limited response times. For some types of interactions, such as sampling external slow-moving sensors, this is not a problem. However, response time can be very important for other events. Flexible and autonomous peripheral interactions are important for both active and sleep modes. If more tasks can be handled autonomously, the MCU core can occupy lighter or deeper sleep modes for longer. Autonomy is also important in terms of response time and determinism in active modes, by allowing peripherals to perform normally without needing to compete for the CPU’s attention against other higher-priority interrupts. Building autonomy into MCU peripherals, including allowing inter-peripheral exchanges without CPU intervention, can be critical to achieving battery-life goals as well as functional goals such as responsiveness. Øivind Loe, Senior Manager, 32-bit Microcontroller Products, Silicon Labs