Idle Task Sleep Mode
The first, easy, step to save power is to allow the RTOS to place the processor into a low power mode when it enters the Idle Task. To remain responsive, the processor will wake up on the next interrupt. If no external interrupt is triggered, this will be the next RTOS Tick interrupt.
For example, with OPENRTOS® or SAFERTOS® this simple power saving feature is implemented by placing the processor into a low power mode from within the Idle Task hook function, as shown in Figure 1. The power saving that can be achieved by this simple method is limited by the necessity to periodically exit and then re-enter the low power mode to process RTOS Tick interrupts.
Figure 1: The Interaction of the RTOS and Idle Task During Sleep Mode
RTOS Scheduling Efficiency
It is a commonly held belief that adding an RTOS to an embedded design will create additional processing overhead, resulting in greater power usage. For simple designs, where a polling ‘super loop’ architecture may be more appropriate, this could be true. However, for more advanced, complex designs, deploying an RTOS using an event based scheduling algorithm typically reduces the amount of processing time required to run your application, allowing the selection of a smaller processor or adding functionality.
Figure 2: The Interaction of the RTOS and Idle Task During Ultra-Low Power Mode