Key Points Often Overlooked in Embedded Low-Power Design

Designing embedded systems increasingly demands longer standby times and extended battery life. The ability to optimize battery life helps reduce field maintenance costs and ensures that customers can enjoy a good product experience without needing to constantly replace batteries or recharge.
The team employs many standard techniques to help extend battery life. For example, placing the processor in low-power mode, turning off unused peripherals, etc. However, some development teams often overlook a few standard techniques.
In today’s article, we will explore several low-power design techniques that are often neglected but can have a significant impact.

Key Points Often Overlooked in Embedded Low-Power Design Abandon GCC, Use Commercial Compilers Key Points Often Overlooked in Embedded Low-Power Design

As software developers and teams, we have become accustomed to using free and open-source tools. We often forget that, in most cases, you get what you pay for. While GCC is a great tool, it is not suitable for every situation. One of these is low-power, battery-operated devices.
Recently, some performance measurements were made to compare the code execution between GCC and IAR’s EWARM compiler. Compiling the same code for the same processor with the same settings can improve code performance by 20 – 30%. The results vary by operation, but these numbers are staggering.
This means that using a commercial compiler may allow you to execute the same code faster, which means you can return to sleep mode more quickly. The longer the device stays in sleep mode, the less current it consumes, leading to longer battery life.
Using a commercial compiler could be an easily achievable goal, allowing you to gain better code performance and save battery life.
Note: Results will vary based on the extent to which you optimize your code. However, most of the time, commercial compilers outperform open-source compilers.

Key Points Often Overlooked in Embedded Low-Power Design Use Tickless Mode to Extend Sleep Time Key Points Often Overlooked in Embedded Low-Power Design

A problem with low-power mode is that if you are using an RTOS, the kernel tick (Tickless) will periodically wake the system. It is not uncommon to set the tick to one millisecond. What happens if you want the device to sleep for a full minute before waking up? Well, during that minute, you will wake up 6,000 times more than you would like, wasting precious battery life.
A simple solution in many RTOS is to use tickless mode. The idea behind this mode is that when the system goes to sleep, it adjusts the low-power timer so that the RTOS does not tick every millisecond. It may not even occur for several minutes, hours, or even days.
This allows the system to remain in sleep mode and prevents it from waking up and executing a bunch of unnecessary CPU instruction cycles. Thus, less current is used, leading to longer battery life.
Note: The method of enabling tickless mode and the work developers may need to invest varies by RTOS.

Key Points Often Overlooked in Embedded Low-Power Design Utilize Internal Cache Key Points Often Overlooked in Embedded Low-Power Design

For many years, microcontrollers did not have caches. They were resource-limited devices. But that is not the case today. If you look at microcontroller components from companies like ST, NXP, and many others, you will find that most have internal caches. If you are designing for low power, you can leverage the cache to reduce energy consumption.
Caches have various mechanisms to help you reduce current consumption. Most relate to the primary function of caches: providing faster access to frequently used data or instructions, thereby reducing the time spent accessing slower main memory by the CPU.
For example, you can use caches to optimize memory access patterns. Caches can significantly optimize energy usage in applications with predictable memory access patterns. By effectively prefetching and caching the required data and instructions, microcontrollers minimize high-energy access to main memory.
Compared to other onboard memory, this cache offers lower latency and higher access speeds. Less time is spent accessing memory, resulting in fewer idle cycles for the CPU. Faster access also means the CPU can complete tasks more quickly, reducing overall active CPU time. All of these contribute to lowering the overall energy consumption of the processor, thus extending battery life.

Key Points Often Overlooked in Embedded Low-Power Design Conclusion Key Points Often Overlooked in Embedded Low-Power Design

When developers and teams consider low-power design, they often jump straight to sleep modes, clock gating, and other techniques to reduce energy consumption. While these are great techniques, they sometimes overlook some simple, readily available techniques.
Low-power design requires consideration of many factors. You can optimize energy indefinitely, but there will often be a “tipping point” during the optimization process that leads to diminishing returns in battery life. Therefore, it is essential to keep track of how these techniques extend battery life.
· END ·
Key Points Often Overlooked in Embedded Low-Power Design
Key Points Often Overlooked in Embedded Low-Power Design

Leave a Comment