Reader small image

You're reading from  Embedded Systems Architecture - Second Edition

Product typeBook
Published inJan 2023
PublisherPackt
ISBN-139781803239545
Edition2nd Edition
Right arrow
Author (1)
Daniele Lacamera
Daniele Lacamera
author image
Daniele Lacamera

Daniele Lacamera is a software technologist and researcher with vast experience in software design and development on embedded systems for different industries, currently working as freelance software developer and trainer. He is a worldwide expert in TCP/IP and transport protocol design and optimization, with more than 20 academic publications on the topic. He supports free software by contributing to several projects, including the Linux kernel, and his involvement within a number of communities and organizations that promote the use of free and open source software in the IoT.
Read more about Daniele Lacamera

Right arrow

Power Management and Energy Saving

Energy efficiency has always been one of the leading factors in the microcontroller market. Since the early 2000s, signal-processing 16-bit RISC microcontrollers, such as the MSP430, have been designed for extremely low-power usage and are still leading the path of ultra-low-power optimization architectures in embedded systems.

In the last few years, more advanced 32-bit RISC microcontrollers, rich in features and capable of running real-time operating systems, have scaled down in size and power consumption, and set foot in the low-power and ultra-low-power domains. Battery-powered systems and devices relying on energy-harvesting techniques are becoming more and more common in many industries. Low-power wireless communication is now offered by a number of connected platforms, so an increasing number of IoT systems include low-power and ultra-low-power characteristics in their design.

Depending on the architecture, microcontrollers offer different...

Technical requirements

System configuration

A system that includes power consumption constraints in its specifications must be designed to meet the requirements in all its aspects, including hardware, software, and mechanical design. The selection of components and peripherals must take into account their energy profiles. External peripherals are often the most power-demanding components, and thus their power source must be interrupted by the microcontroller when they are not being used.

This section will describe the best practices concerning peripheral configuration, system clock settings, and voltage control, and their impact on power consumption.

Hardware design

In low-power embedded systems, the hardware design must include the possibility to power peripherals on or off using a GPIO pin. This is better done using a line that is normally low so that it can be pulled down using passive components when the GPIO is not driven by the microcontroller. MOSFETs are often used to control the power supplied...

Low-power operating modes

Microcontrollers can execute in different power modes, switching from full performance to complete hibernation. A proper understanding of the microcontroller’s low-power modes is fundamental to designing systems with improved energy profiles. Each architecture provides specific power configurations, where the CPU or other buses and peripherals are disabled, as well as appropriate mechanisms to be used by the system software to enter and exit low-power modes.

In an ARM-based microcontroller, the terminology used for the different low-power modes can be summarized as follows:

  • Normal operation mode: Active components are selected through clock gating, and the clock is running at the desired frequency.
  • Sleep mode: The CPU clock is temporarily suspended, but all the peripherals keep functioning as in normal mode. As long as the CPU is not executing, there is a noticeable, even if marginal, amount of power saved in this mode. Execution can...

Measuring power

The current in use by the target can be measured at any time by connecting an ammeter in series with the device. This mechanism, however, does not show all the oscillations of the values during a time interval, which is why it is often useful to sample the values of the parasitic voltage at the ends of a shunt resistor using an oscilloscope.

A shunt resistor is placed in series with the target device, on either side of the power source. Its typical value is relatively small, in the range of a few ohms, to ensure that the parasite voltage stays low, but is still measurable by the oscilloscope:

Figure 8.1 – Measuring the current using an oscilloscope to sample the voltage applied to the shunt resistor

Figure 8.1 – Measuring the current using an oscilloscope to sample the voltage applied to the shunt resistor

Due to the properties of a series circuit, the current running through the shunt is the same as the one used by the target system, so the voltage on the ends of the shunt resistor varies accordingly.

Development boards

In order...

Designing low-power embedded applications

In this section, a few design patterns are proposed to achieve a better energy profile on the target device, by evaluating the power demand of all the components and the states of the system we are about to design. Once we know how to measure the values in the target, and the details about the low-power mode in the selected architecture and microprocessor family, the application can be programmed, keeping other parameters in mind, such as the energy efficiency of the software we are writing.

Replacing busy loops with sleep mode

The reason busy loops are very popular among hobbyists is that they are so easy to implement. Suppose that the system needs to wait for a digital input to switch to a low-logic state, and this input is mapped to a certain GPIO. This can be easily done with the following one line of code:

while((GPIOX_IDR & (1 << INPUT_PINX)) != 0)
  ;

While this is perfectly working as expected, it will...

Summary

Modern embedded systems open multiple possibilities for low-power and even ultra-low-power designs. This chapter analyzed the different energy profiles available for the reference microcontroller and how to design, integrate, and evaluate those procedures to control power usage in energy-aware embedded systems. Having understood several options available for the target, implementing low-power modes and further types of energy-saving techniques is the key to building durable and reliable battery-powered and energy-harvesting devices.

In the next chapter, we will switch focus to introducing connected devices and describing the impact of dealing with network protocols and interfaces in the embedded system architecture.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Embedded Systems Architecture - Second Edition
Published in: Jan 2023Publisher: PacktISBN-13: 9781803239545
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Daniele Lacamera

Daniele Lacamera is a software technologist and researcher with vast experience in software design and development on embedded systems for different industries, currently working as freelance software developer and trainer. He is a worldwide expert in TCP/IP and transport protocol design and optimization, with more than 20 academic publications on the topic. He supports free software by contributing to several projects, including the Linux kernel, and his involvement within a number of communities and organizations that promote the use of free and open source software in the IoT.
Read more about Daniele Lacamera