In my previous blogs (see list below) I examined an MCU design's active and standby modes, giving some suggestions to reduce the current consumption. This installment is dedicated to the transitions between active and standby modes.
In applications that demand deep sleep modes to maximize every nA, the microcontroller should stay in sleep mode as long as possible. It should also wake up to execute the next periodic task in the shortest possible time and, when finished, return rapidly to standby mode.
Modern microcontrollers can be placed in a variety of low-power modes, each corresponding to different values of current consumption and different wakeup possibilities. This variety provides product designers with a choice of sleep modes, offering the flexibility to scale basic resources, and thereby the power consumption, in several defined levels or energy modes. But there’s little point in offering a microcontroller with tremendous low sleep-mode energy consumption if its energy efficiency gains are lost due to the time taken for the microcontroller to wake up and enter active mode.
When a microcontroller goes from a very low-power sleep mode, where oscillators and PLLs are disabled, to the active mode, there is always a wakeup period. During this period the microcontroller must wait for the oscillators and PLLs (if used) to stabilize before it can start to execute code. A general, obvious rule is that the deeper the standby level is, the longer the wakeup time will be. This is partly because the lowest current consumption state corresponds with the lowest number of peripherals enabled, and some of them need a proper startup time of their own to stabilize -- after the clock source stabilization time.
Because no processing can be performed during this time, the energy spent during wakeup is wasted. Reducing the wakeup time is thus vital to reducing a design's total energy consumption.
There are other benefits to a short wakeup time. Low-power embedded applications may impose short reaction-time constraints to events, which often means that the wakeup time must allow the microcontroller to respond to an event within the defined time period. Because the latency time constraint in many applications is lower than the wakeup time from deep sleep for many microcontrollers, however, the design is often inhibited from using the deepest possible sleep mode.
One possible solution would be to use a very fast, internal RC oscillator, often present in newer microcontroller families. Clock stability might not be an issue during the first part of a wakeup routine, so that fast clock could instantly get the CPU started while the other oscillators or PLLs stabilize. Then, if necessary, the design can transfer the clock source to the crystal oscillator and PLL, once it's stable.
When the microcontroller finishes executing its tasks in active mode, it has some work to do before going to the appropriate low-power mode. First, it has to turn off all the peripherals not needed during sleep. It also has to set all the necessary microcontroller register flags to appropriate values. This shutdown time should be the shortest possible, but it will vary with the application and the microcontroller technology.
When looking for a microcontroller to use in a low-power design, then, designers have to examine more than just the current consumption specs for active and low-power modes. Often the time the microcontroller needs to wake up from a given low-power mode can disqualify it from consideration because that mode could never be used.
One more factor to take into consideration is the granularity that the low-power modes support. Does the MCU allow the designer to turn on and off individual peripherals, or must it be whole blocks? Does the mode preserve the microcontroller's registers and RAM memory contents? Answers to these questions can tell you which low-power mode is optimal for your application.
Next time I will write about software's effect on power consumption in low-power designs.
Related posts: