Optimizing Low Power Embedded Designs
This article focuses on the major factors contributing to power consumption in an embedded system by analyzing the various power modes which most microcontrollers offer today.
The need for low power embedded designs has always been high motivated by the desire to run applications for as long as possible while consuming the minimum power. In a battery powered system, this need is magnified. Furthermore, in battery powered systems low power implies lower cost of operation and smaller battery size to make applications more mobile. When energy comes at a premium as it does with today’s green initiatives, ensuring that an embedded design consumes as little energy as possible assumes significant importance in wall-powered applications as well.
Designing power-efficient applications also ensures lesser overhead to manage thermal dissipation and the generation of heat is controlled at the source by optimizing the power consumed. Keeping the above obvious advantages in mind, embedded application designs today can no longer ignore the problem of optimizing power. This article will focus on the major factors contributing to power consumption in an embedded system by analyzing the various power modes which most microcontrollers offer today. Then, we will analyze a real-life example of an embedded application in terms of power consumption and how its efficiency can be maximized.
MCU Power Consumption
To begin, there are several points to be aware of when selecting an MCU or external components. Overall power consumption of a MCU is defined by its power consumption in different modes, typically active and standby (includes sleep, hibernate etc.) and taking into account the power consumed to transition from one mode to another. Let us go through these power modes in more detail.
Active power consumption by an MCU is the power consumed when the MCU is running. As almost all controllers are based upon CMOS logic, power is consumed primarily during switching. As a starting point, let us analyze the power consumption of a CMOS inverter (figure 1) which is the basic building block of any CMOS design.
Figure 1: CMOS inverter
CMOS circuits dissipate power by charging the various load capacitances whenever they are switched. When considering internal architectures, this is mainly the gate capacitance but there are drain and source capacitances too. Power is dissipated across the PMOS transistor while the load capacitor is being charged and across the NMOS when the load capacitor is being discharged. Instantaneous power dissipation across NMOS transistor of CMOS inverter (Figure 1) is given by equation 1.
PPMOS i = iL(Vdd - Vo) – (1)
After substituting the value of iL in equation 1:
PPMOSi= CL (Vdd - Vo) dVo/dt -- (2)
Total power dissipation across the PMOS to switch the output from low to high can be found by integrating power dissipation across the PMOS to the charge load capacitor from 0 V to Vdd:
PMOS power consumption, PPMOS = ½ CLVdd2 -- (3)
Similarly, to switch the output from high to low, total power dissipation across the NMOS is:
NMOS power consumption, PNMOS = ½ CLVdd2 -- (4)
For one switching cycle, then, power dissipation is:
PTotal = PNMOS + PPMOS = CLVdd2 -- (5)
If we define the average power in terms of switching frequency (f), we get:
P = fCLVdd2 -- (6)
From equation 6 it can be seen that power consumption depends upon switching frequency, load capacitance, and supply voltage. Load capacitance is determined by the technology parameters and the design layout and is therefore beyond the control of the embedded system designer. However, the other two factors – switching frequency and supply voltage – are factors a system designer can modify with an intention to impact power efficiency for a given microcontroller. Of course the value of these parameters is also heavily dependent on the application of the design.
However, modern controllers run at an internal regulated voltage irrespective of the input voltage on the supply pins. There are controllers available in market which can be operated from 0.5 V to 5.5 V, but the internal core runs at a fixed regulated voltage like 1.8V irrespective of the supply voltage. Therefore, this parameter is not that important in the case of modern controllers as it was in the past. However, it is good to keep the supply voltage to the minimum requirement for regulators or near the voltage where the regulator is bypassed.
This leaves system designers have just one parameter available for affecting power control: switching frequency. Hence in the active mode, the minimum required operating speed for the MCU should be calculated and higher clock speeds should be avoided.
The other major factor which determines battery life is the standby power consumption of an embedded system. Most applications can spend significantly periods of time in standby mode. In these systems, the major contributor towards total system power consumption is the standby current rather than the active current. Standby current is the sum of leakage current, current consumed by power management circuits, clocking systems, power regulators, RTC, IOs, interrupt controllers, and so on. It varies from controller to controller, based upon the particular features supported in standby mode.
Finally, power consumption while transitioning from low power mode to active mode should not be overlooked. Devices may end up in wasting significant amount of power while transitioning between these two modes.
Based on these power modes, an MCU’s average power consumption is:
MCU average power consumption = (Active Power + Sleep Power + Transition Power) / Total Time – (7)
Where, Active Power= Time for which MCU is active * Active Current; Sleep Power= Time for which MCU is in sleep * Sleep Current;
Transition Power= Power consumed while making transition from sleep to active mode
The amount of time the system remains in active and standby mode is application dependent. Some applications may need to have MCU running all the time while some may need to have it running only occasionally. There are MCUs available on the market which come with additional power down modes other than sleep, such as hibernate mode, deep sleep mode, or shut down mode in which power consumption can be on the order of 10s of nA. System designers need to look at the power consumption in the mode specifically in which his system has to operate for the majority of time to ensure the overall design is power efficient.
If we look deeper, there are some vital tradeoffs that must be considered. For some applications, it could prove beneficial for the system to run at a higher speed so it can finish its job faster and return to low power mode. Alternative, other systems may do better running at a slower speed to keep active power consumption low. Here, the system designer has to analyze the best case for the application considering the current at different operating speeds, the time it takes to come out of low power mode, the current consumption in low power mode, and the frequency with which the system needs to switch between active and sleep modes.
MCU power consumption is only one factor when considering system power consumption. Sometimes, engineers tend to concentrate too much on the MCU and ignore the power consumption by external peripherals. If the objective is to optimize the power consumption of the entire embedded system solution, one cannot afford to do this.
Consider a simple temperature measurement system for home use (see Figure 2).
Figure 2: Temperature monitoring system
This system has one ADC to measure the sensor voltage, one DAC to generate a reference, one LCD module to display data, and one MCU to process the data. Power should be saved beginning at the individual block level. If the power consumption is calculated for this system, it will be given by:
Total power consumption = MCU power consumption + ADC power consumption + DAC power consumption + LCD power consumption
For this system, the sample rate need not be very high since temperature does not change rapidly. Power consumption can be kept to minimum by switching on the ADC and DAC only when required and optimizing the time ratio for which the MCU stays in active and standby mode. If this system is made of discrete components, it can get quite challenging to coordinate. Power consumption for discrete component-based architectures will look similar to the system shown in Figure 3.
Figure 3: Power consumption system using discrete-based solution
In Figure 3, standby current is mainly contributed to by MCU standby current and the active current of the ADC, DAC and LCD. The ADC may have an option by which the MCU can stop ADC conversion before it goes to sleep to save ADC power consumption as well. However, there will still be some standby current for ADC and similarly for the DAC. Alternatively, the system could be implemented using a system-on-chip (SoC) architecture where all of the peripherals are integrated onto a single chip along with the ability to control the power of each individual peripheral. Power consumption of this system will look similar to shown in Figure 4 and can lead to a dramatic reduction in power consumption compared to a discrete component-based implementation.
While designing any system, we should use what is needed rather than using what is available. When requirements are overestimated, such as choosing a faster or more sophisticated component that is needed, this results in higher cost and lower power efficiency. For example, a 20-bit ADC running at a 1 Msps speed is clearly more than is needed for a temperature measurement application. In addition, the ADC needs a high-frequency operating clock to sample at this rate.
Figure 4: Power consumption of SoC-based solution vs. discrete solution
Advancements in SoC technology allows developers to access a wide range peripherals on-chip such as filters, ADCs, DACs, Op-amps, and programmable analog and digital blocks. For example, PSoC devices from Cypress Semiconductors have a wide operating frequency range with programmable clock sources for different blocks including the MCU, and support numerous power management modes. These modes range from active mode where all the features on the device are available to hibernate modes where current can be as low as 100 nA while retaining the contents of configuration registers and RAM.
As complex as SoC architectures are, they represent almost the complete system, making it more straightforward to compute power consumption. For example, if the system is doing nothing, then the standby current of the whole system can be as low as 100 nA. Since peripherals and the MCU can be switched on or off individually, only the appropriate blocks can resume operation after the next wake up event. This is one of the key features which an SoC can have from a system point of view. In some system, it is possible that for a certain period only some hardware functions are needed and not the MCU, such as, for example when generating a waveform using a DAC. This task can be completed by the DMA (Direct Memory Access) and DAC without the MCU, and so the MCU can be switched off. SoCs enable user to design ultra low power embedded systems that are also cost and space efficient, with the added advantage of fast time to market.
A system’s average power calculation in SoC-based system becomes more complex since along with the average MCU current, we need to consider each the operating state of each individual peripheral on the chip. Average system current is:
Battery life is a critical specification for any battery powered application. Battery ratings are given in the units of mA -Hr, meaning it can supply ‘X’ mA of current for one hour. If we know the average current, we can calculate the battery life:
Battery Life = Battery rating/ Iavg --(9)
Equation 9 will give the battery life in Hours if Iavg is given in mA.
Power consumption is one major factor which almost every consumer cares about in both wall-powered and battery-powered devices. In today’s competitive market, designing a product which consumes higher power or which costs more competitive products can result in reduced market success. When optimizing power consumption is a major criterion, designers should look at critical parameters like choosing the appropriate components and making sure that they are not overrated for the desired end application, as well as making sure the system does not operate at higher speeds than are required. In addition, developers will want to seriously consider how long the system spends in active and standby modes and the relative power consumption in each.
Sachin Gupta is working as Senior Applications engineer with Cypress Semiconductors. He holds Bachelor’s degree in and Communications from Guru Gobind Singh Indraprastha University, New Delhi. He loves working on different analog and digital circuits and synthesizable codes. He can be reached at his email ID firstname.lastname@example.org.
Madhan Kumar is working with Cypress Semiconductors as an Applications Engineer. He holds a Bachelor’s degree in Electronics and Communications engineering.He can be reached at email@example.com.