Home / Learn Embedded C / Polling vs Event-Driven Design
Polling vs Event-Driven Design
Two fundamentally different architectural approaches to structuring an embedded program's main loop.
Breaking it down
What it is
Polling-based design repeatedly checks each input/condition in a loop looking for changes; event-driven design reacts to interrupts or flags set by them, only doing work when something has actually happened, rather than continuously re-checking.
Why it matters
This is a recurring architectural choice threading through this entire course (GPIO polling vs pin-change interrupts, UART polling vs receive interrupts) — this lesson names and generalizes the pattern so it can be applied deliberately to new design decisions.
Mechanically speaking
Pure polling wastes CPU time (and power, connecting back to the Low Power Design group) continuously checking things that have not changed; pure event-driven design adds interrupt-handling complexity but can be dramatically more efficient, especially combined with sleep modes.
Shows up in
- Main loop architecture decisions
- Power-conscious design
- Course-wide pattern recognition
Try it
Polling spends CPU time on every tick regardless of whether anything changed; an event-driven design only runs at the one tick that actually mattered.
Try it: polling at two different rates
Even within pure polling designs, the chosen poll interval itself trades responsiveness against wasted CPU work — a slower poll means fewer wasted checks but more latency.
Check yourself
1. Why does event-driven design generally combine better with low-power sleep modes than pure polling?
A purely polling design must keep the CPU active to keep re-checking conditions, while an event-driven design can sleep and rely on an interrupt to wake it only when something relevant actually occurs.