Source: https://mokxi.com/learn/path/firmware-architecture
Updated: 2026-11-11

All paths

# Firmware architecture

How a whole device is put together on the Uno: a scheduler and state machines, ISRs that only record, drivers behind interfaces, checked settings in EEPROM, error codes and the watchdog, safe updates, and a layered multi-sensor boss.

Arduino Uno R3 Free 7 lessons 7 h 4 chapters 4,350 XP Embedded engineering · Expert +400 XP

0 of 7 done

Start the course free Superloops and state machines Lesson plan for teachers

What you will build

## 3 projects, built step by step

7 lessons in 4 chapters, about 7 hours on a simulated Arduino Uno R3. Free, in your browser, every step checked by the simulator.

Chapter 1 project

### Interrupts and buffers

An ISR that only records each edge and its time into a ring, a main loop that drains and debounces it, volatile and atomic reads done right, and an overflow counter that tells you when the loop fell behind.
Open it in the simulator

Chapter 2 project

### Configuration and EEPROM

Settings in an envelope: a magic number, a version, a size and a CRC-16, checked field by field at every boot, defaults when anything is off, only changed bytes written, and a watchdog reset to prove it all survives.
Open it in the simulator

Chapter 3 project

### OTA and bootloader concepts

How a device updates itself without ever bricking: A/B slots, an image header with a version, a length and a CRC-32, trial boots that must confirm, automatic rollback, and a minimum version that refuses a perfect copy of old firmware.
Open it in the simulator

The map

## Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

## Structure

A superloop, a scheduler, a machine in a table, and ISRs that only record.

Open 430 XP

### Superloops and state machines

A cooperative scheduler that runs tasks on their own periods, a state machine whose behavior lives in a transition table, and a stopwatch on every pass of loop() that catches a task breaking the one rule.

0 of 7 steps

Start What is in it

Project Locked 860 XP

### Interrupts and buffers

An ISR that only records each edge and its time into a ring, a main loop that drains and debounces it, volatile and atomic reads done right, and an overflow counter that tells you when the loop fell behind.

0 of 7 steps

Chapter 2

## Layers

Drivers behind interfaces, and settings that survive a reset.

Locked 430 XP

### Drivers and hardware abstraction

A comfort monitor that only talks to a ClimateSensor and a Display interface: a DHT22 driver, an LCD driver, and a scripted fake that plays a heat wave, a dry room and a dead sensor on demand.

0 of 7 steps

Project Locked 860 XP

### Configuration and EEPROM

Settings in an envelope: a magic number, a version, a size and a CRC-16, checked field by field at every boot, defaults when anything is off, only changed bytes written, and a watchdog reset to prove it all survives.

0 of 7 steps

Chapter 3

## Survive the field

Error codes, fail-safe states, the watchdog, and updates that cannot brick.

Locked 430 XP

### Error handling and watchdogs

A heater controller whose functions return error codes, a policy table that retries or trips a latched fail-safe, and the chip's real watchdog in its two-stage mode: task check-ins, last words saved to EEPROM, then a reset.

0 of 7 steps

Project Locked 860 XP

### OTA and bootloader concepts

How a device updates itself without ever bricking: A/B slots, an image header with a version, a length and a CRC-32, trial boots that must confirm, automatic rollback, and a minimum version that refuses a perfect copy of old firmware.

0 of 7 steps

Chapter 4

## Boss

A multi-sensor machine guard built from every layer in the course.

Locked 480 XP

### Boss: a layered machine guard

The sensor lab becomes a real device: drivers for an LM35, a Hall switch and a slotted wheel, a scheduler with check-ins, a table-driven machine, checked thresholds in EEPROM, error codes and a latched trip.

0 of 8 steps

Syllabus

## Every lesson in the course

All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

### Structure

- Superloops and state machines A cooperative scheduler that runs tasks on their own periods, a state machine whose behavior lives in a transition table, and a stopwatch on every pass of loop() that catches a task breaking the one rule.
- Interrupts and buffers An ISR that only records each edge and its time into a ring, a main loop that drains and debounces it, volatile and atomic reads done right, and an overflow counter that tells you when the loop fell behind.

Chapter 2

### Layers

- Drivers and hardware abstraction A comfort monitor that only talks to a ClimateSensor and a Display interface: a DHT22 driver, an LCD driver, and a scripted fake that plays a heat wave, a dry room and a dead sensor on demand.
- Configuration and EEPROM Settings in an envelope: a magic number, a version, a size and a CRC-16, checked field by field at every boot, defaults when anything is off, only changed bytes written, and a watchdog reset to prove it all survives.

Chapter 3

### Survive the field

- Error handling and watchdogs A heater controller whose functions return error codes, a policy table that retries or trips a latched fail-safe, and the chip's real watchdog in its two-stage mode: task check-ins, last words saved to EEPROM, then a reset.
- OTA and bootloader concepts How a device updates itself without ever bricking: A/B slots, an image header with a version, a length and a CRC-32, trial boots that must confirm, automatic rollback, and a minimum version that refuses a perfect copy of old firmware.

Chapter 4

### Boss

- Boss: a layered machine guard The sensor lab becomes a real device: drivers for an LM35, a Hall switch and a slotted wheel, a scheduler with check-ins, a table-driven machine, checked thresholds in EEPROM, error codes and a latched trip.

Keep going

## The rest of your track

Firmware architecture is part of the embedded track, a ladder of courses from zero to expert.

Track

### Embedded track

Arduino, ESP32, Raspberry Pi Pico and STM32: pins, timing, buses, motors, WiFi, registers and debugging, every lesson checked on a simulated board.
See every course on the track

Kits

## Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

Have a kit already?

### Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kit

Questions

## About Firmware architecture

Is Firmware architecture free?

Yes. All 7 lessons of Firmware architecture are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real Arduino Uno R3?

No. Every lesson runs on a simulated Arduino Uno R3 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Firmware architecture take?

About 7 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: Interrupts and buffers, Configuration and EEPROM and OTA and bootloader concepts.

Where do I start?

With "Superloops and state machines", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.
