Battery innovation is not moving as fast as other technological advantages. With battery capacity doubling every 10 years and processing requirements increasing much quicker, developers are faced with difficult challenges. When building a battery-powered system, product developers often create efficient hardware systems only to see much higher power consumption than expected. In embedded systems optimization, hardware is only half of the equation that must be considered. The other half is software.
Microcontroller (MCU) software can be managed to ensure maximum battery performance. If you are looking to get started, consider these tips:
- Maximize time in standby– standby-mode current of a MCU is often orders of magnitude lower than active-mode current. This is often due to power gating of non-essential peripherals and system modules while waiting for an event to occur.
- Use interrupts to control program flow– This is about efficiency of code. Every line of code being executed consumes clock cycles and in turn your system battery life. Use interrupts to make intelligent decisions about what section of code to execute based on the state of a system.
- Replace software functions with peripheral hardware– Implementing security functions, such as encryption, can require thousands of cycles to execute in software. On our low-power MSP MCUs, 128-bit encryption can be reduced from 6600 clock cycles to 168 cycles, all by using the included hardware module. Similar performance benefits can come from simple modules such as hardware multipliers that can simplify math functions dramatically.
- Manage power of internal peripherals– Even if not in a standby mode, non-essential peripherals should always be turned off.
- Manage power of external devices– The concept of turning off non-essential components does not stop within the MCU. The MCU in a system can be used to turn components on/off when needed to maximize battery life.
- Device choice can make a difference– Remember, not all MCUs are created equal. Applications have varying requirements for time in active or standby mode. Choose an MCU that is optimized for your duty cycle. Also, keep in mind that wakeup time from standby modes can become an important factor if the application required moving from active to standby mode often.
Efficient software is definitely a “must” to ensure battery life maximization. The tips above should help, but there are many additional factors to consider and optimization utilities can help. If using TI’s MCUs, check out our software optimization options to help simplify your development. To start, ULP Advisor helps check your code against an ultra-low-power checklist to provide guidance on potential software improvements. EnergyTrace™ technology then provides real-time power profiling capabilities so that you can see exactly where, and how much, power is being consumed. To learn more about TI’s ultra-low-power MCUs and software, visit www.ti.com/msp.