How embedded systems work: the hidden computers in everyday things, and how engineers build them
Firmware: the program that runs in an endless loop inside a device
Your laptop starts programs and closes them all day. The small computer in a washing machine or a cat flap runs one program from the second it gets power, and that program never stops, not even at night.
-
1
Rono puts the cover back on. Nobody presses a button and nothing asks for a program, yet the flap is already at work.
-
2
The moment power comes, the chip starts the one program kept in its storage. That program is the firmware. It lives in flash, a storage that keeps it, and the list of known cats, even with no batteries.
-
3
The firmware does one thing, over and over: it looks for a cat in the tunnel, reads its number, and opens only for Miva's cat. Then it starts again from the top, thousands of times a second, and firmware writers call it the main loop.
-
4
The grey cat tries first, and its number is not on the list, so the latch stays shut. A minute later, Miva's cat comes home, and the flap opens for it.
-
5
Rono does a sum: with a reader that sends its waves all night and a loop that never rests, four batteries would be flat in a few days. Yet the box says up to a year. How?
-
Quick check
Four batteries out, then back in.
Show the answer
Yes. The firmware and the list of known cats are kept in flash, which keeps them with no power.
-
Go further
Where the work in progress goes, and two old words.