This article will focus on the various ultra-low-power control features available in the new generation of embedded microcontrollers and how engineers can use these features to extend the expected life of batteries in wireless sensor nodes.
Power management function
So, what is "low power"? Before we go on, let's first discuss some terminology. "Energy" is related to the total amount of work done, while "power" measures the rate at which work is done (energy used per unit time). In electricity, energy = power × time, and power = voltage × current. Therefore, the key system parameters we want to focus on are voltage, current, and time. Specifically, at what voltage does my application run, how much current does it consume, and for how long will it run?
To study this problem from the perspective of MCU, we first need to explore the various power consumption modes of new MCUs.
Power Mode
根据处理需求,应用具有一组显著不同的预设工作模式。嵌入式单片机可利用其众多外设中的一个来采样来自周围环境的信号。在外设收集到一定数量的采样之前,单片机可能无其他事要做。那么单片机可能会在每次数据采样之间"休眠"或进入超低功耗待机模式。一旦应用程序读到了足够多的数据采样,单片机即可轻松切换至"全速运行"模式,此时单片机被唤醒并以最大工作速度运行。
The microcontroller will usually receive some type of wake-up event to exit from various low-power modes. The wake-up event can be triggered by an external stimulus signal such as an I/O pin level toggle or an internal processor activity such as an interrupt event generated by a timer peripheral. The specific power modes supported by the microcontroller vary, but generally the various power modes have some commonalities. Typical power modes are as follows:
●"Always Run" mode
● "Sleep" or "Standby" mode, in which the memory remains powered
● "Deep Sleep" or "Deep Hibernation" mode, in which the memory is powered off to maximize power savings.
"Always running" mode
"Always on" mode embedded systems consist of devices that are constantly powered and in operation. The average power consumption requirements of these systems are likely to be in the sub-milliamp range, which directly limits the processing performance that can be achieved by the microcontroller. Fortunately, the new generation of embedded microcontrollers has the ability to dynamically control their clock switching frequency, which helps reduce the operating current consumption when high computing power is not required.
Standby mode
在"待机"模式下,系统工作或处于低功耗非活动模式。在这些系统中,工作和待机电流消耗都非常重要。在大多数待机模式系统中,由于保持对单片机存储器通电,虽然电流消耗显著减少,但仍可保持所有的内部状态及存储器内容。此外,可在数秒内唤醒单片机。通常,此类系统在大
Most of the time in low power modes, but still need fast startup capability to capture external or time-critical events. Keeping power to the memory helps maintain software parameter integrity and the current state of the application software. Typical startup times to exit from power modes are usually in the 5-10 μs range.
Deep Sleep Mode
In a deep sleep or "deep sleep" mode system, the system is either running at full speed or in a "deep sleep" mode that can significantly save power. This mode is particularly attractive because it maximizes energy savings by completely shutting down the embedded microcontroller core, including on-chip memory. Since the memory is powered off in this mode, critical information must be written to non-volatile memory before entering deep sleep mode. This mode reduces the power consumption of the microcontroller to an absolute minimum, sometimes as low as 20 nA. In addition, all memory parameters need to be reinitialized after waking up the microcontroller, which increases the overall wake-up reaction time. Typical startup times to exit from this mode are usually in the range of 200 - 300 μs.
In these ultra-low-power mode systems, the life of the battery is often determined by the current consumed by other components in the circuit. Therefore, care should be taken to focus not only on the current consumed by the microcontroller, but also on the current consumed by other components on the PCB (printed circuit board). For example, if possible, designers can use ceramic capacitors instead of tantalum capacitors, which generally have higher leakage currents. Designers can also decide which other circuits to power when the application is in a low-power state.
Taking Advantage of Power Modes
Next, consider a representative scenario where the choice of different MCU power modes can have a dramatic impact on the total power used by the system. Taking a basic remote temperature sensor as an example, this application collects data over a long period of time, perhaps processes the data using a sophisticated noise filtering algorithm, and then puts the MCU back into standby mode until more sample measurements are needed. It also uses wireless radio frequency (RF) transmission to report the temperature information to a central control station.
Sampling the temperature requires the use of the MCU’s on-chip analog-to-digital converter (ADC) and only moderate processing power. During the noise filtering phase, the microcontroller must use a higher processing power mode to calculate the advanced filtering algorithm and store the results back to memory as quickly as possible. As a result, the total time the microcontroller is running and consuming power is reduced.
At predetermined intervals, the microcontroller combines all the sampled results and sends them to the central control console using an RF transceiver device. Precise timing is required to ensure that the wireless sensors send this information within the pre-assigned time slots, allowing multiple wireless sensor nodes in the same system to work together.
How do we manage how often we wake up the processor? By using a timer peripheral in conjunction with an integrated 32 kHz oscillator circuit, the microcontroller can generate an interrupt very accurately every second, thus ensuring the wake-up time is accurate. This interrupt event also enables the microcontroller to fill the sampling buffer with temperature data according to a predetermined schedule.
After the microcontroller has filled the temperature sample buffer, it switches to a higher processor speed mode to complete the more sophisticated noise filtering algorithm calculations and then returns to sleep mode as quickly as possible to reduce the operating time. The microcontroller uses the same real-time clock function to determine when to send the captured sample data back to the central control station. Determining the best power mode for the microcontroller to minimize the overall current consumption depends on several factors, which will be discussed below.
Optimizing power consumption in low-power applications
To minimize total power consumption, it is not enough to simply select the MCU's lowest power mode. We must also determine the amount of work the MCU needs to complete for each task - for example, sampling an external temperature sensor. Once the performance requirements for each task are determined, we must also determine the best energy utilization for each task. For the formula mentioned earlier: Energy = Time × Voltage × Current, we usually cannot change the voltage in the formula because the overall system needs and the actual power supply determine the voltage value, so we can only manipulate two parameters, time and current. We need to balance the operating time of the MCU and the current consumption. Let's explore some MCU-specific parameters to keep in mind when performing the above analysis.
Processor wake-up
After the microcontroller is placed in a low-power mode, there are some external sources that can wake it up. The wake-up event can occur through a USB event, a real-time clock event, or even an external trigger signal on an I/O pin. The time it takes for the microcontroller to wake up from a low-power "sleep" mode and begin executing code is very important. Usually, we strive to make this time as short as possible, which is why we choose between the "sleep" and "deep sleep" operating modes. If the microcontroller wakes up once a second, this mode may be the best choice because when waking up from "sleep" mode, the microcontroller can begin executing code in 10 μs without first initializing any software memory locations. If the microcontroller is in a low-power state for a long time - for example, it wakes up only once every few minutes or even hours, then the "deep sleep" mode may be the best choice. The key is to minimize the total current consumption of the microcontroller. If the microcontroller is in a low-power shutdown mode for a long time, then a wake-up time of 300 μs will be insignificant compared to the minutes or hours of deep sleep time.
Another great example of a system-level wake-up event can be demonstrated using an external RF chip connected to the processor via a serial interface. When the processor is not in use, it can be put into a low-power state, leaving only the RF chip running. Since the logic of newer generation RF chips is only responsible for looking for incoming RF packets, they consume very little current when in operation. Once a valid packet is received associated with the address assigned to the unit, it wakes up the microcontroller to begin processing the information. This type of power mode mechanism is more commonly used in RF network-based solutions, such as those based on the ZigBee wireless protocol.
Clock frequency
The microcontroller obtains the system clock frequency from an external or internal clock source. The microcontroller takes this clock frequency and divides it down to get the operating clock frequency required by the application software. Lower frequencies usually equate to lower power consumption. Sometimes, the microcontroller can also use a phase locked loop (PLL) to multiply the external clock frequency. The external clock signal usually comes from a crystal oscillator or crystal oscillator.
The microcontroller can also disable the input crystal amplifier circuit when the device enters a low power mode, which may save a few milliamps of current, but at the expense of longer oscillator on-time (due to the external crystal start-up delay) when normal operation is resumed. However, some microcontrollers have the ability to use a two-speed start-up mode, in which the microcontroller will start running immediately using the internal oscillator and automatically switch to the external clock source after the more accurate external clock source has had time to stabilize.
Previous article:The difference between MCU and PLC
Next article:How to enter the world of microcontroller development
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- 【Wireless closed-loop feedback system for desktop robotic arms】
- 8/21-22@Wuhan! Intel/World Peace Group invites you to participate in the Artificial Intelligence Technology Introduction and Implementation Seminar
- Professor Li Xia: How basic should basic research be?
- 【i.MX6ULL】Driver Development 11——LCD Driver Practice
- Microcontroller interview question collection
- HEF4051 is easy to damage
- Microchip Automotive Innovation Series Online Seminar Invites You to Attend!
- [STM32WB55 review]——by damiaa
- 【DIY Creative LED】WS2812 test successful
- RISC-V MCU Development (XII): Command Line Operations