In real time systems using an RTOS, what how would the RTOS handle an idle period? Would it run nop instructions at the lowest frequency supported by a Dynamic Voltage Scaling capable processor? or would it turn to a sleep state? Can anyone refer me to actual practical implementations. Thanks
I depends entirely on the system requirements. Systems that need to operate at very low power could go to sleep until the next interrupt. Other systems might have plenty of power but need to be very reliable...these could be doing self-tests in the background task.
It would most likely go to for one of the device's sleep mode.
It's very quick (often a matter of a single instruction) and designed to do exactly that: fill inactive periods with inactivity ;) This in turn helps to save power.
However, if power is not a concern to you, you may simply "halt" in a polling loop until a continue condition occurs.
Clocking the system down seems like a "half-way solution" - doesn't make much sense to me.
You asked about a practical implementation. Here are the QNX power management definitions. It's highly customizable.
General CPU Power Mode Definitions
Our sample power policy is based on four general power mode definitions: Active/Run, Idle, Standby, and Shutdown. Because the QNX power management framework is completely customizable, these power mode definitions are used for convenience only. There are no assumptions or dependencies on these definitions. The general CPU power modes can be defined as follows:
Active/Run - The system is actively running applications. Some peripherals or devices may be idle or shutdown.
Idle - System is not running applications. CPU is halted. Code is all or partially resident in memory.
Standby - System is not running applications. CPU is halted. Code is NOT resident in memory.
Shutdown - Minimal or zero power state. CPU, memory, and devices are all powered off.
These definitions are used as a guideline only. Multiple subsets can be defined for each state (i.e. Idle1, Idle2, etc.). Further, not all these CPU power modes may be required or even possible for a specific board or CPU.