Micros

Designing with energy-efficient microcontrollers

7th November 2012
ES Admin
0
The increased use of embedded microcontrollers in electronic equipment coupled with a world energy crisis will force electronics engineers to look at hitherto ignored power-saving features of these devices. Dr. William Marshall, Semiconductors Content Editor at RS Components discusses energy-efficent and power-saving features of embedded microcontrollers in this article from ES Design Magazine.
Back in 1976 a new computer was launched: the Cray 1. At the time it earned the title ‘Supercomputer’ because of its incredible processing power of 160MIPs at a clock rate of 80MHz. Computing power wasn’t its only record breaking feature; the Cray 1 required a 115kW power supply and was packaged in a case not much bigger than a UK telephone box. To stop it melting, a powerful Freon-based refrigeration plant was incorporated in the structure. For comparison with technology available today, consider the Parallax Propeller microcontroller; it’s a 32bit bus machine compared to the Cray’s 64 but it too manages 160MIPs with an 80MHz clock. The significant difference (apart from physical size) is in the power required to achieve that performance. The Propeller has an average power consumption of just 1 Watt and many newer devices can do a lot better than that. The 64bit dual-core Intel Atom-based PC consumes so little power that the current-sensing mains socket expander it’s plugged into fails to notice it’s been switched on.

The coming of VLSI led inevitably to computers with a much better processing power to supply power ratio. Early NMOS chip technology gave way to CMOS, which promised even lower demands on the power supply. A characteristic of CMOS is that significant current is only drawn when a logic device changes state. This means that the faster it is clocked the higher the average current consumption for a given microcontroller. So a particular MCU will have two contributions to the power budget: static and dynamic.

Static reduction

Energy is consumed by the device through leakage even if the clock is turned off. In newer devices individual circuit elements are being packed closer together reducing insulation resistance and requiring a drop in the supply voltage. Logic able to operate at +1.8V is quite common now, with some working with a supply as low as +0.9V. For example the Microchip nanoWatt XLP range of PIC microcontrollers can operate over the voltage range +2.5 to +5.5V up to a maximum clock frequency of 32MHz. If you can make do with 16MHz, then the supply can be dropped to +1.8V providing peripheral devices will also work with this low voltage. This produces a drop in both the voltage and the frequency dependent power consumption.

If no special power-saving modes are available then always consider using the lowest clock speed possible compatible with getting the task completed in the time available. For something as simple as a TV remote control for example, a ‘watch’ crystal frequency of 32kHz is often used.

In more complex situations, these fixed or static solutions may be unsuitable because the processing load may vary and high-speed operation is maintained ‘just in case’. In these situations a technique called Dynamic Voltage Scaling (DVS) may be used where software analyses the processor demand and causes the clock speed and supply voltage to be varied accordingly. However the savings calculations are complex and many factors such as memory usage must be considered.

Dozing and Sleeping

Early micros had no special operating modes to save power: probably because their processing power was so low that applications allowing the processor to ‘doze off’ were deemed unlikely! The invention of the battery-portable digital instrument changed all that. Mobile phone design requirements have since driven development in both energy-efficient MCUs and battery technology. One of the first MCUs to feature an Idle mode was the Intel 80C51. New devices have introduced a whole menu of power saving modes most of which consist of shutting down functions when they are not needed. Most microcontrollers are now used in ‘real-time’ control situations requiring bursts of activity followed by perhaps complete inactivity for long periods. The TV remote control is an extreme case where the processor can be completely shut down until a button is pressed. The average current consumption can be little more than the self-discharge rate of the battery.

Increasingly, real-time systems are moving away from the single central processor model to a central high-level controller, fed ‘partially processed’ data from ‘intelligent’ sensors. The MCU attached to each sensor device will likely be taking analogue samples at fixed intervals, performing some DSP operations and then transmitting the result on a serial bus. In this case the sensor MCU is ‘woken up’ by a timer at each sampling interval. Now things get interesting: should you select a simple 8bit microcontroller or fast 32bit type, say based on a Cortex M0 core? Logically, the 8bit MCU seems more efficient because it’s cheap and will be fully committed for most of the available processing time. In fact, the 32bit device might be better in terms of average current consumption because it can complete the task quickly and then go to sleep (see figure below).

However even this technique must be used with caution: there will be an optimal clock speed and not necessarily the maximum. In other words completing the task in the shortest possible time with the fastest clock won’t always yield the lowest average current consumption. Fortunately much of the speed improvement over the old 8bit device will be down to a more powerful instruction set featuring single-cycle 32bit multiplication for example. But don’t despair if an old 8051-based design needs to be improved while retaining software compatibility; the 8051 core has seen dramatic improvements in execution efficiency (fewer clock cycles per instruction) as well as big increases in overall clock speed. The Silicon Laboratories range, for example, provides single-cycle instructions at up to 100MIPs. When using the sleep modes an important consideration is the Wake-up time. Oscillators can take milliseconds to produce a stable output and this represents wasted time and power. With short duty-cycles the MCU might have barely woken-up before the next wake-up call arrives!

The Microchip nanoWatt MCUs feature a ‘doze’ mode which allows the processor clock to run more slowly than the peripheral clocks. This works in situations where the peripheral device must work at full speed, but the processor doesn’t have a lot to do while waiting for a peripheral interrupt.

##IMAGE_2_C##

Cutting power supply wastage

You’ve designed your microcontroller system for lower power consumption, but what about the power supply itself? If you’re an old hand you might just go for a trusty 78xx series linear regulator, but these are now considered completely obsolete if still popular. Although more expensive always go for a newer low dropout (LDO) type.

A 7805 +5V output regulator has a dropout voltage of 2V, which means it needs a minimum of +7 volts on the input. At the maximum current of 1A at least 2W are wasted as heat and a heat sink will almost certainly be needed. An LDO type cuts the dropout to perhaps 300mV. Now that means a lower voltage mains transformer can be used cutting the waste. Better still, use a switching regulator for even greater efficiency. However, remember that the PSU must be rated for the peak current consumption – not the average.

Finally, include pull-ups on all unused I/O inputs. Random noise on a floating input can switch internal circuits and even if the resulting signals are blocked and cause no spurious operation, it all adds to the total dynamic current. Some devices feature internal ‘weak pull-ups’, but opinion seems to be divided on their efficacy and many developers stick to using external resistors.

Energy costs are top of everyone’s agenda at the moment and as electronic equipment continues to proliferate in the domestic market, design engineers must assume that power consumption will be a critical factor in their projects. Fortunately the need for low power devices in battery portable equipment started the process of energy-efficient chip design some years ago. Now this new chip technology combined with energy saving software will help reduce wastage in mains-powered equipment as well.

Product Spotlight

Upcoming Events

View all events
Newsletter
Latest global electronics news
© Copyright 2024 Electronic Specifier