Embedded Systems
Learn C through the building blocks of firmware. Work with registers, sensors, timing, and state machines before bringing them together in smart thermostat firmware.
What helps
An interest in how electronic devices work is enough to choose this path. You will meet binary values and bit operations early; basic circuit concepts provide useful context.
C pathway
Programming Foundations / Practice rooms / Track curriculum and enrollment
Bits & Registers
Embedded programming is bit manipulation. A microcontroller's peripherals are controlled by registers, and you configure them by setting, clearing, and testing individual bits. Master the bitwise operators, masks, bit fields, and fixed-width integer types that every later peripheral depends on, then wrap them into a clean control-register abstraction.
- Bitwise Basics: 5 lessons
- Masks & Bit Fields: 5 lessons
- Fixed-Width Integers: 5 lessons
- Bytes & Words: 5 lessons
- Capstone: A Control Register: 5 lessons
GPIO & Digital I/O
General-purpose I/O pins are how a microcontroller touches the world: lighting an LED, reading a button. We model the three classic registers, DDR (direction), PORT (output), and PIN (input), as bytes, and build the driver layer that reads buttons and drives LEDs. Buttons are active-low, the real-world convention.
- Output Pins: 5 lessons
- Input Pins: 5 lessons
- Whole-Port Operations: 5 lessons
- LED Patterns: 5 lessons
- Capstone: A GPIO Driver: 5 lessons
Timers, PWM & Delays
A microcontroller's sense of time comes from hardware counters that tick and overflow. Use them to measure elapsed time (handling wraparound), convert between ticks and real units, generate PWM to dim an LED or position a servo, and build software timers. All integer math, the way embedded code avoids slow floating point.
- Counters & Overflow: 5 lessons
- Converting Time: 5 lessons
- Pulse-Width Modulation: 5 lessons
- Software Timers: 5 lessons
- Capstone: A Timer Module: 5 lessons
ADC & Sensors
An analog-to-digital converter turns a voltage into a number. Convert raw ADC counts to millivolts and to physical units, do fractional math with fixed-point integers (no floating point on a small MCU), and clean up noisy readings with averaging and filters. The thermostat's temperature input is built here.
- The ADC: 5 lessons
- Fixed-Point Math: 5 lessons
- Sensor Conversion: 5 lessons
- Filtering Noise: 5 lessons
- Capstone: Temperature Pipeline: 5 lessons
Serial Communication & Protocols
Microcontrollers talk to the world over serial links. Work out UART timing and framing, protect data with checksums and a CRC, build and parse packets, and bit-bang the SPI and I2C buses by hand. The thermostat reports its readings with the packet protocol built here.
- UART Framing & Timing: 5 lessons
- Checksums & CRC: 5 lessons
- Building Packets: 5 lessons
- Bit-Banging Buses: 5 lessons
- Capstone: The Reporting Protocol: 5 lessons
Interrupts & Scheduling
Interrupts let hardware events grab the CPU's attention. An interrupt service routine sets a flag; the main loop reads it. Build the flag handling, edge detection, time-based debouncing, and a cooperative scheduler that runs tasks at their own rates, the superloop that will run the thermostat.
- Interrupt Flags: 5 lessons
- Events & Edges: 5 lessons
- Debouncing in Time: 5 lessons
- A Cooperative Scheduler: 5 lessons
- Capstone: A Tick Scheduler: 5 lessons
State Machines
Embedded behavior is naturally a finite state machine: a set of states and the events that move between them. Build transition functions, drive a traffic light, drive transitions from a table, decode button-press patterns, and finish with the thermostat's mode controller.
- FSM Basics: 5 lessons
- A Traffic Light: 5 lessons
- Transition Tables: 5 lessons
- Button-Press Patterns: 5 lessons
- Capstone: Thermostat Mode Controller: 5 lessons
Constrained Memory
A microcontroller might have a few kilobytes of RAM and no heap. You manage memory by hand: ring buffers for streaming data, fixed pools instead of malloc, bit arrays to pack flags, and explicit byte packing for storage and transmission. The thermostat's reading log is a ring buffer built here.
- The Ring Buffer: 5 lessons
- Fixed Memory Pools: 5 lessons
- Bit Arrays: 5 lessons
- Byte Packing & Endianness: 5 lessons
- Capstone: A Reading Log: 5 lessons
Embedded Control
Closing the loop: read a measurement, compare it to a setpoint, and drive an actuator to close the gap. Build on-off control with hysteresis, proportional control, and a full integer PID controller with anti-windup, all in fixed/integer math. This is the brain of the thermostat.
- On-Off Control: 5 lessons
- Proportional Control: 5 lessons
- Integer PID: 5 lessons
- Conditioning the Loop: 5 lessons
- Capstone: The Thermostat Controller: 5 lessons
Capstone: Smart Thermostat Firmware
The finale. Bring every project together into one firmware for a smart thermostat: a Thermostat struct holds the state, the sensing path turns ADC counts into a filtered temperature, the control path runs the PID, the output path drives the heater and reports over serial, and a superloop ties it all into a single firmware step, the complete embedded system, built from scratch in C.
- The System State: 5 lessons
- The Sensing Path: 5 lessons
- The Control Path: 5 lessons
- Output & Reporting: 5 lessons
- The Superloop: 5 lessons