You are viewing an older revision! See the latest version
Power Management
In the current technology used for CMOS integerated circuits, the primary source of power consumption occurs during switching:
Power = Capacitive load x Voltage2 x Clock Frequency
So to reduce power, you need to reduce one or more of these terms. Capacitive load is a function of both the gate technology and the number of transistors. An end user cannot change the gate technology, but they can power down unused hardware devices to lower the capacitive load. Many devices have hardware support to turn off various I/O hardware units. In recent years, voltage levels have been reduced on logic from 5V to 3.3V and internal devices in many processors use core voltages near 1V. Reduction below 1V is unlikely due to device physics. An end user can select lower power 3.3V devices instead of 5V when possible to reduce power in a design. Processors have been able to increase clock frequency to run faster as IC circuits have become smaller. A faster clock unfortunately also increases power levels. So turning off the clock, or slowing down the clock whenever excess CPU time is available can be used to reduce power levels. Many processors have hardware support to vary or turn off the clock. Some reduced power levels will still be required even with the clock off to save the values in registers and volatile RAM memory, so that the device can wakeup without a full reboot.
Reducing power is not only green, it saves money by saving power. Over the life of a computer system, the money spent to power and cool the device can cost as much as the device itself. So well engineered designs need to minimize power whenever practical. Devices running off of batteries such as cellphones need power management for long battery run times. A fully powered cellphone would run down the battery in just a few minutes without power management.
Mbed was not designed for very low power levels, but it is still possible to save significant power with a little additional effort. The processor includes support to power down unused devices, vary the clock rate, and enter low power Sleep modes. Here is a simple code example showing how to get started on using the power management features to reduce the power levels on mbed. The code blinks the LEDs using a bit less than half of the normal power levels. This code is based on some power control information in the forums at
http://mbed.org/users/no2chem/notebook/mbed-power-controlconsumption/
and some new experimental firmware that allows the USB interface chip to reduce power levels at http://mbed.org/users/simon/notebook/interface-powerdown/. This is helpful when running mbed from limited power sources such as batteries.
#include "mbed.h" #include "PowerControl/PowerControl.h" #include "PowerControl/EthernetPowerControl.h" // Need PowerControl *.h files from this URL // http://mbed.org/users/no2chem/notebook/mbed-power-controlconsumption/ // Function to power down magic USB interface chip with new firmware #define USR_POWERDOWN (0x104) int semihost_powerdown() { uint32_t arg; return __semihost(USR_POWERDOWN, &arg); } DigitalOut myled1(LED1); DigitalOut myled2(LED2); DigitalOut myled3(LED3); DigitalOut myled4(LED4); Ticker blinker; int count=1; void blink() { count = count << 1; if (count > 0x08) count = 0x01; myled1 = count & 0x01; myled2 = count & 0x02; myled3 = count & 0x04; myled4 = count & 0x08; } int main() { int result; // Normal mbed power level is around 690mW // // If you don't need networking... // Power down Ethernet interface - saves around 175mW // Also need to unplug network cable - just a cable sucks power PHY_PowerDown(); // If you don't need the PC host USB interface.... // Power down magic USB interface chip - saves around 150mW // Needs new firmware (URL below) and USB cable not connected // http://mbed.org/users/simon/notebook/interface-powerdown/ result = semihost_powerdown(); // Power comsumption is now around half // // use Ticker interrupt and Sleep instead of wait - saves around 70mW // Sleep waits for an interrupt instead of executing instructions blinker.attach(&blink, 0.0625); while (1) { Sleep(); } }