Archive for August, 2007

h1

System Hardware Strategies to Extend Battery Life

August 28, 2007

Last time, I talked about software strategies for reducing power. This time, I’d like to talk about hardware strategies. From a hardware standpoint, controlling power to peripherals, both internal to the MCU and external, can save considerable power. It is straightforward enough to disable on-chip peripherals using the MCU’s control registers. But it may not be as obvious to disable peripherals external to the MCU. Using general I/O pins, power can be controlled to external circuits.

Power discreet and IC components

Now discreet components such as LEDs and photosensors may be obvious candidates for controlling with I/O, but just about any circuit can be controlled in a similar fashion. If the component requires more current than the MCU can provide directly, buffers can be used as power switches to these circuits. In some cases, simply connecting several I/O pins in parallel can provide enough current.

Use hardware modules for monitoring input

Another hardware/software trick is to use modules with interrupts to monitor external signals versus polling the input. If you just need to observe a rising or falling edge, use an interrupt pin. If you need to know a relative time the edge occurred, use a timer input capture. Both timers and pin interrupts can operate in several low power modes.

For analog signals, a comparator combined with an ADC channel can create a very efficient monitor. The Freescale MCU’s comparator uses a fraction of the current of the ADC module. Configure the comparator to run in a low power mode and trip at a threshold voltage. When the MCU wakes, the ADC can measure the same signal for a more accurate reading. Several Freescale MCUs even have comparators and ADC channels on the same pins to make this simple.

Configure I/O pins for lowest power

The MCU’s I/O pins themselves can be a source of excess current if not configured properly. Unused pins need to be terminated to prevent a floating input from creating a high current path. This is frequently overlooked when using an MCU that comes in a variety of packages.

We tend to forget that the pins available in the highest pin count version are still on the silicon in the lower pin count versions. Any input pin left floating will become a frustrating source of excessive current, many times only under certain circumstances, such as temperature variations. In these cases, an internal pull-up should be enabled, or, if the pin is an I/O, it can be configured as an output (data is irrelevant if it is driving an open circuit).

h1

Packaging and Power

August 21, 2007

Parasitics Everywhere

When you mention a product’s “power consumption,” packaging is not normally the first thing that comes to mind. Usually you’ll conjure up images of battery life or the heat dissipation or the extreme capability of the product. However, packaging plays a key role in a product’s power consumption rate. For this discussion, we will talk about the packaging of multiple components to create a product, such as a mobile phone.

Traditional mobile phones have three main components: a power management IC (PMIC), a baseband modem (BB) and one or more RF transceivers. Information is transferred between these components by signals that flow from one component to another on a printed circuit board (PCB). The PCB has parasitic, or unwanted, capacitances and impedances that the output circuits must drive. If the output circuits are not capable of putting out enough power, the signals between components can be corrupted, which can cause a system failure, such as a dropped call.

The larger the distance between two components, the more parasitic capacitance and impedance the output circuits must drive. So, to reduce the output circuits’ power consumption, the components should be placed as close to one another as possible. This has the additional benefit of making the product smaller. If taken to the extreme, the components can be placed so close that the packages touch one another. The next step is to merge the packages and put both die into the same package. Taking one step further, the two die within a package can be moved closer to each other until they touch, with the final step being both die integrated together onto a single die. Some companies are doing exactly this in the mobile phone arena with their “single chip radios.”

Single Chip vs. Single Package

The one major drawback of single chip radios is that the integration of the various components introduces compromises in the circuit designs, which can lead to less efficient designs that may consume more power. Integrating all components into a single chip also has the unwanted side-affect of making the product inflexible to change.

Freescale is pioneering a new packaging concept called redistributed chip-scale packaging, or RCP. RCP moves the die as close together as practical while still allowing each component to be fabricated in the process that is best optimized for its functionality. For instance, high power circuits like those found on PMICs can be fabricated in a SmartMOS(tm) process that is tailored to source high power. Other examples are fully digital baseband modems and application processors that can take advantage of the smallest geometry processes to make them as small as possible.

RCP not only allows for each function to be fabricated in the most optimum process, but also it allows the flexibility to mix and match components to meet the quickly changing demands of the consumer marketplace. With product lifecycles dropping to less than a year in some instances, this flexibility is very important for new product developers to stay competitive.

Selecting components in the right packages is important to your end product it affects not only the size of your product but also the power consumed.

– Chris

h1

Software strategies to extend battery life

August 13, 2007

From a software perspective, there are some less obvious tricks to reduce power consumption. As stated in a previous post, the best way to conserve power is to stay in the lowest power state for as long as possible. Since run mode with the CPU actively executing instructions is never the lowest power state, we want to minimize the amount of work the CPU must perform. This allows the CPU to complete tasks faster and allows the MCU to return to a low power mode. So, here are some tips for reducing the CPU execution time.

Data types

Match the default data type to the CPU. When writing C code, it is easy to forget that the common integer is usually defined as 16 or 32 bit number, even on compilers for 8-bit MCUs. For 8-bit devices, always default to using the 8-bit char type unless a larger size is really necessary. Even then, you may be able to reduce code size by breaking a 16-bit or 32-bit number into 8-bit slices and only concatenate at the end of the data manipulation.

Conversely, a 32-bit CPU can typically manipulate and move 32-bit data more efficiently than manipulating or moving four 8-bit values. However, if the data really only needs 8-bits, it would be more efficient to use an 8-bit char instead of an integer.

Avoid short loops and small functions

Avoid using short loops or subroutine calls if you can afford the extra memory to use in-line code. Every loop and subroutine uses additional CPU cycles to either determine if the loop is complete or to stack and unstack the program counter. If you know a short loop will always be executed four times, just write the same code four times in a row rather than using a for-next or while loop. If a subroutine only has 10 or 20 bytes of code, consider in-lining it instead of keeping it a subroutine. This will eliminate a fair amount of CPU overhead for simple tasks.

Pre-calculate values

Pre-calculate values when appropriate. For example, assume a wireless link uses two baud rates depending on what the application is talking to. When writing C code it may be tempting to pass the actual baud rate to the serial interface setup routine rather than the actual prescaler value the serial interface requires. After all, this makes the code more readable. However, this also forces the serial interface routine to calculate the prescaler value from the baud rate every time the baud rate is changed. Calculating the prescaler values beforehand and passing these to the serial setup routine will save CPU cycles and code space.

An extension of the pre-calculating concept is using look-up tables rather than complex calculations. Many MCUs have very efficient instructions and address modes for accessing tabled data. Depending on the complexity of the calculation, this can save quite a bit of CPU effort. If calculations are still required, always check for early exits before starting the routine. A simple example is looking for multiplication by ‘1’ or ‘0’.

 

-Scott

h1

Newer is Not Always Better

August 7, 2007

To most people, integrated circuits (ICs) are the little black squares in electronic products that make the product work. How they are made or what’s in these black squares is a mystery to most people. But it’s no mystery that when it comes time to build a system, the process used for fabricating an IC makes a big difference in resulting power consumption rates. Most digital ICs are made on silicon wafers. Transistors are formed in the silicon wafers to create circuits. The various process technologies are usually described in terms of minimum transistor geometries, such as 250 nanometer (nm), 120nm or 90nm. To provide some scale, a typical human hair is 1000 times larger than the transistor dimensions, which is why so many transistors can fit onto an IC no bigger than a thumbnail. The more transistors that can be squeezed onto a die, the more functionality can be provided, which normally allows IC manufacturers to charge more money for their products. So, IC manufacturers continue to invest in shrinking process geometries in order to make more money. Currently, the cutting edge of process geometries is between 45nm and 32nm.

The big trade-off

But as always, there are trade-offs. As the saying goes, “there is no free lunch.” As the process geometries shrink, the device characteristics must be tailored to meet the performance requirements of the end products. As the width of transistors shrink, the gate oxide, or insulator, must be made thinner in order to maintain control of the current flow through the channel of the transistor. Since the gate oxide thickness is reduced, the maximum voltage that can be used on these transistors must be reduced to prevent damaging the devices. A lowered device voltage is good for active power since active power is proportional to the square of the voltage. However, this typically means that the threshold voltage of the CMOS transistor is reduced in order to maintain transistor performance at a lower voltage. The lowered threshold voltage of these small geometry devices allows more current to leak through the channel even when the device is off. The increase in leakage current is not linearly proportional to the shrinking device size. The increase in leakage is exponential. So, when going from a 130nm process to a 65nm process, the leakage can increase by 1000x! If not controlled, the leakage can be hundreds of milliamps (mA).

Years ago, leakage was ignored in most processes. That is no longer the case. Since the leakage is increasing so quickly, the Freescale design engineers work hard designing transistors that maintain the required performance while keeping the leakage under control. One way to do this is to create several flavors of transistors that can be used in the most appropriate ways, such as low performance, low leakage transistors for circuits that don’t need high performance but need low leakage. Or building high performance, high leakage transistors for circuits where performance is critical and the additional leakage can be supported.

Choosing the right components

So what does this mean when it comes time to choose the components for a low power system? The answer depends on the type of system you are developing.

A: If your system is running all the time, such as a network server, then selecting components that can operate at the lowest voltage is probably the best, since it minimizes active power consumption. Typically, components made in the newer technologies support the lower voltage supplies.

B: If your product is in a low-power state most of the time, such as a smoke detector, a low standby current component is probably the best. Typically, components made in the older process technologies have lower standby or leakage currents.

C: If your product is sometimes active and sometimes in standby, such as a mobile phone, a compromise is required to balance a component’s active power and standby power consumption. Components specifically designed to optimize both active and standby power should be chosen. Typically, components made in the newer technologies that also incorporate leakage control techniques meet the critical demands of the end products.

These guidelines are just general rules. Your product’s specifications will dictate the exact requirements for component selection. If more discussion is required, please send in your comments.

— Chris