Hybrid Hardware Driven Scheduling

MCUs generally offer hardware features (peripherals) for managing time bases, e.g., real-time counters/clocks, general timer counters, system ticks, watchdog timer, etc., which all can be used to drive a scheduling scheme. A common approach is to implement the while(1) application loop, as discussed above, where each task is associated with a global flag that controls whether or not the task is due to run in the next possible time slot. The associated flag is in turn controlled by a peripheral interrupt, which controls one or several flags depending on the application.

This approach somewhat simplifies the control of each task, and when it is due to run. It also makes code and tasks more reusable between applications. However, the same latency constraints exist, since the task with the longest execution time cannot run longer than the expected latency in the system. Also, the number of available peripherals limits the number of available control flags, which in turn limits the controllable number of tasks.