Design Tips Save MCU Power

Microcontroller experts share techniques that help reduce power in embedded systems.

Microcontrollers offer engineers a variety of power-saving techniques. But using them effectively requires careful attention to tradeoffs in software and hardware at the start of a project.

"Engineers must partition their application so they have a rough idea how long their microcontroller will stay in a sleep mode or in an active mode," said Mike Salas, MCU marketing director at Silicon Laboratories. "Often they say they already have lowered power but they might not know other ways to lower it even more."

"Transitions between active and sleep modes take time and use power, so you want an MCU that minimizes the wake-up and go-to-sleep times," said Salas. "When the MCU goes between those states often, it can use a lot of power."

The low-power sleep modes can offer designers their own tradeoffs. "If you use an MCU's internal ADC to measure a sensor voltage, you might power the analog circuits but turn off the digital circuits," said Salas. "Then the ADC can collect values and at an appropriate time you can turn on the rest of the MCU to processing the collected values."

"Many MCUs include comparators and ADCs," continued Salas. "So you can set a threshold voltage for the comparator and only wake up the CPU and ADC when the comparator detects a voltage that exceeds the threshold. So you reduced the duty cycle of the MCU's higher-power peripherals."

"You also can set a window for the ADCs in some of our MCUs, such as the F9xx MCUs and the Si10xx wireless MCUs," said Salas. "The ADC continues to make measurements, but if the resulting value remains within the window, say a narrow room-temperature range for a home thermostat, the ADC discards the measurement. It doesn’t interrupt the CPU and cause it to use processor cycles that waste power. Only when the ADC's values exist outside the window would any processing occur. Of course you could set up an inclusive window instead."

"You also can use the internal clocks to save power," noted Keith Odland, MCU marketing manager at Silicon Labs. "Say an MCU must wake up periodically, add 1000 values, process the result, and go back to sleep. For that asynchronous task you wake the CPU so it uses the lowest power high-speed oscillator. That's not a precision oscillator, but it wakes up quickly and uses less power than a high-precision oscillator."

"Now, suppose you have a task that communicates at 115,200 bps," said Odland. "You need precise timing, so you wake up the precision oscillator but divide the frequency to give the slowest speed the CPU could run at and still generate that bit rate. So by shifting peripheral operations dynamically can you achieve very low power levels."

Periodic tasks that run in software are relatively easy to schedule in a microcontroller so your code can turn it on or off regularly, explained John Weil, global product and enablement manager for MCU business at Freescale Semiconductor. "That's the usual 8- or 16-bit model. But now we see more background communication via ZigBee radios, UARTs, and other channels. So, it's difficult for a traditional MCU engineer to thinking about handling so many asynchronous tasks in a power-sensitive application through awake and sleep modes. In a 32-bit MCU, engineers must consider power management as soon as they start to plan their approach to software."

"32-bit MCUs give us the capability to create software more adept at managing power," said Weil. "We provide real-time operating systems and drivers so engineers can have many tasks going on simultaneously. The RTOS is 'aware' of all the current tasks and can help accurately predict when the MCU will have idle time and thus drop into a low-power mode."

People who use 8- and 16-bit MCUs can still save power through careful design methods. "Many engineers use 'distributed computing' that involves more than one MCU," said Weil. "Today’s MCU offer so many capabilities they can usually satisfy all their processing and I/O requirements with one chip.

And the engineers must look outside the MCU for ways to save power. "A company used a low drop-out [LDO] regulator to step down a voltage to for an MCU," said Weil. "But they thought the power use of the MCU seemed excessive. It turned out the LDO saved money but was only 65-percent efficient. So they wasted a lot of power before they even got to the MCU."

"Consider battery chemistry, too," cautioned Weil. "The life of a 3V lithium 2032 or 2020 coin cell degrades exponentially if you exceed certain current thresholds. So if an MCU requires a high startup current it could decrease battery lifetime. Lithium coin cells tend to do well in circuits that create a very-low-current steady discharge. Lithium-ion batteries work better in circuits that require burst currents, because the battery has a bit of a 'bounce back' after a small discharge. In digital cameras, for example, lithium-ion batteries work better than nickel-metal-hydride or nickel-cadmium batteries because the image sensors tend to require bursts of currents."

"Our application engineers like to get a customer's schematic or block diagram because more often than not they will find ways to save more power or reduce bill-of-material costs," said Salas of Silicon Labs.