Embedded Systems & Firmware
Which describes the "super loop" structure often seen in microcontroller programs without an OS?
- AAn infinite loop in main calls each task in turn forever, with urgent work handled by interrupts
- BEach task is a separate process switched by an OS
- CThe microcontroller reboots after each task finishes
Show answer and explanation
Answer: A. An infinite loop in main calls each task in turn forever, with urgent work handled by interrupts
In a super loop, after initialization, a "while (1)" loop keeps calling tasks such as reading sensors, computing and updating a display in order. Time-critical work is done in interrupts, which notify the loop with flags. It needs no OS, uses little memory and is easy to follow. But if one task takes long, everything else is delayed, so an RTOS is considered when the work grows complex.
- A. Correct. It is simple and suits small microcontrollers.
- B. That is an OS-based structure.
- C. There is no rebooting.