Embedded Systems & Firmware

Which describes the "super loop" structure often seen in microcontroller programs without an OS?

  1. AAn infinite loop in main calls each task in turn forever, with urgent work handled by interrupts
  2. BEach task is a separate process switched by an OS
  3. 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.
Practice this topic Back to topic

More Embedded Systems & Firmware questions

  1. What is the main purpose of using an RTOS (real-time operating system) in embedded devices?
  2. In a preemptive RTOS, while a low-priority task is running, a high-priority task receives the data it was waiting for and becomes ready. What generally happens?
  3. Which describes priority inversion in an RTOS?
  4. Which describes priority inheritance, used to prevent priority inversion?
  5. In an RTOS, what is the advantage of using a queue (message queue) to pass data from a sensor-reading task to a display task?