IT lexicon › Programming › Superloop

Superloop

Programming På svenska → Updated: 2026-11-03

The simplest firmware architecture: an endless while(1) loop that calls each task in turn, with interrupts as the only exception to the queue.

Once clocks and peripherals are set up, main() enters a loop that never returns. Each pass reads the buttons, checks flags left by interrupt handlers, refreshes the display and starts over. It also goes by foreground/background: interrupts are the foreground that reacts immediately, the loop is the background that deals with everything else when it gets round to it.

The appeal is that the whole program fits in one function and there is no scheduler to spring surprises. The catch is that response time equals the slowest pass through the loop — one blocking delay and everything stalls. Anyone who starts bolting on state machines and timestamps to work around that is, in effect, writing their own RTOS, only worse.

← Back to the lexicon