Overview of Low Power Design Based on RTOS

This issue’s topic:

Low Power Design Ideas Based on RTOS.
More and more embedded products are based on RTOS as the software platform, and some products have higher requirements for low power consumption. This article discusses how to handle the low power characteristics of microcontrollers in RTOS.
Let’s discuss:
This article only briefly discusses the design ideas; for more detailed designs, refer to the related documentation of the RTOS used.
The RTOS generally adopts a time-slice round-robin preemptive task scheduling mechanism. In practical applications, the general low-power design ideas are as follows:
  • When the Idle task is running, enter low power mode;

  • Under appropriate conditions, wake up the MCU through interrupts or external events.

When the OS system timer generates an interrupt, it will wake the MCU from low power mode. However, frequently entering/exiting low power mode prevents the MCU from entering deep sleep.
The design idea of Tickless Idle Mode is to keep the MCU in low power mode as much as possible when it is idle.
From the above scenarios, the problems that software design needs to solve are:
1. Reasonably enter low power mode (avoid unnecessary switching of the MCU between low power mode and running mode).
The system clock of RTOS comes from a certain periodic timer in the hardware (most Cortex-M series cores use SysTick), and the RTOS task scheduler can anticipate the trigger time of the next periodic task (or timer task).
Adjusting the interrupt trigger time of the system clock timer can prevent RTOS from entering unnecessary time interrupts, thus allowing it to stay in low power mode for a longer time. At this time, the clock of RTOS is no longer periodic but dynamic (no interrupts will occur on the original clock baseline, i.e., Tickless).
2. When the MCU is awakened, provide compensation for the system clock in some way.
The MCU may be awakened by two situations: dynamically adjusted system clock interrupts or sudden external events. In either case, the time the MCU spent in low power mode can be calculated using some timer running in low power mode, and software compensation for system time can be performed after the MCU wakes up;
3. When implementing software, handle issues according to specific application scenarios and the low power characteristics of the MCU.
Especially for the MCU low power characteristics, different MCUs can use different peripherals (mainly timers) in different low power modes. The system clock of RTOS can be appropriately adjusted.
Source: Let’s Learn Embedded Together
Friendly Reminder:

Due to recent changes in the WeChat public platform push rules, many readers have reported not seeing updated articles in time. According to the latest rules, it is recommended to click on “Recommended Reading, Share, Collect, etc.” more often to become a regular reader.

Recommended Reading:

  • Official Announcement: 51-year-old Meng Wanzhou has a new identity!

  • Within a day, two factories in Dongguan announced closure.

  • Is a monthly salary of 10,000 untrue? Exposed Tesla’s Chinese factory maliciously withholding performance bonuses.

Please click 【See】 to give the editor a thumbs up

Overview of Low Power Design Based on RTOS

Leave a Comment