Try Embedded

Learn embedded C and firmware

135 lessons from your first C program to RTOS, drivers, wireless and embedded Linux, with runnable examples and quizzes.

1. Programming foundations

Write your first C programs. No experience needed.

1.1 C from zero

2. Embedded C

The C that firmware is built from, and the C++ that fits a microcontroller.

2.1 Data and memory

2.2 C for hardware

2.3 C++ for embedded

3. How a microcontroller works

Electronics basics, the processor, interrupts and time, and everything between your source code and a running chip.

3.1 Electronics for firmware

3.2 Processor, interrupts and time

3.3 From source to running code

3.4 Two Cortex-M33 cores: the Raspberry Pi Pico 2

4. Peripherals and protocols

The on-chip peripherals every product uses, the buses that connect chips together, and storing data that must survive power-off.

4.1 Core peripherals

  • GPIO · Pin modes, push-pull versus open-drain, pulls, edge interrupts and debouncing.
  • Timers and PWM · Prescalers, auto-reload, input capture, output compare and dead time.
  • ADC · Resolution, sampling, noise, oversampling and DMA.
  • DMA · Transfer modes, circular buffers, half-transfer interrupts and cache coherency.
  • Watchdog timer · Independent and windowed watchdogs, and feeding them correctly.

4.2 Serial communication

  • UART · Baud rate, framing, errors, flow control and DMA reception.
  • SPI · Clock modes, chip select, multiple devices and throughput.
  • I2C · Addressing, repeated start, clock stretching and bus recovery.
  • Protocols, framing and checksums · Checksums, CRCs, byte order, framing and parsing a byte stream.
  • CAN · Arbitration, bit timing, frames, CAN FD and error handling.
  • USB · Enumeration, descriptors, endpoints, transfer types and device classes.

4.3 Industrial, automotive and audio buses

  • RS-485 and Modbus · Differential multi-drop wiring, driver enable, and the Modbus RTU protocol.
  • LIN and 1-Wire · Two cheap single-wire buses: automotive LIN and 1-Wire sensors.
  • I2S audio and Ethernet · Streaming audio between chips, and wired Ethernet from MAC to PHY.

4.4 Storage

5. Firmware architecture

Structuring firmware that stays correct as it grows: state machines, an RTOS and well-designed drivers.

5.1 State machines

5.2 Real-time operating systems

5.3 Designing firmware

6. Quality and engineering practice

Finding bugs methodically, testing without hardware, measuring power, and the everyday practice of a firmware team.

6.1 Debugging and testing

6.2 Engineering practice

7. Specialisations

Go deep in the area your target job needs. Each module stands on its own.

7.1 Networking

7.2 Wireless

7.3 Embedded Linux

7.4 Safety and security

7.5 Power and EMC

7.6 Signals, control and motors

7.7 Rust and TinyML

Advanced tracks

  • Automotive ECU diagnostics · Every ECU in a car answers a workshop tester. Learn the two protocols that carry that conversation, ISO-TP and UDS, and the fault memory, security and coding rules behind them, at the depth a tier-one supplier interviews for. Then write the diagnostics of a body control module on an STM32.
  • Reliability, power and security engineering · The skills that separate firmware that works on the bench from firmware that survives ten years in the field: recovering from resets, brown-outs, flipped bits and locked buses; budgeting every microamp of a battery's life; and defending the device against someone who holds it, from signed updates with rollback to constant-time checks and glitch-resistant decisions. Then harden a sensor node on an STM32 while the simulator injects every one of those faults.

More guides

  • Embedded C quick reference · The idioms, sizes and rules worth having on one page before an interview.
  • Hardware kit and labs · What to buy to move from the simulator to real boards, at three budgets, and a lab that takes each guided build onto real hardware.
  • Presenting your projects · Turning your builds into a portfolio: the repository and README, the résumé line, and telling the story in an interview.