Skip to content
Tutorials Center
My learning

Topics

Embedded Systems Tutorial

Learn Embedded Systems step by step: 37 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is an Embedded System? Learn what an embedded system is, where you find them, how they differ from desktop software, and the constraints (memory, power, time) that shape every design.
  2. 2 The Embedded Development Workflow Understand how firmware gets from source code to a running chip: cross-compiling, linking, flashing, bootloaders and on-chip debugging, with runnable simulations.
  3. 3 Choosing a Board and Toolchain Compare Arduino/AVR, STM32, ESP32, Raspberry Pi Pico, nRF52 and RISC-V boards, and learn how to pick a microcontroller and toolchain for your first embedded projects.
  4. 4 Your First Program: Blinky Write the "hello world" of embedded systems: configure a pin as output, toggle an LED, add delays, then see why busy-wait delays are bad and how non-blocking timing works.

Microcontroller Architecture

  1. 5 Microcontroller vs Microprocessor Compare microcontrollers, microprocessors, SoCs and DSPs: what is inside an MCU, Harvard vs von Neumann, 8/16/32-bit cores, and ARM, AVR and RISC-V families.
  2. 6 The CPU Core and the Instruction Cycle See how a microcontroller CPU works: registers, program counter, stack pointer, status flags, the fetch-decode-execute cycle and pipelines, with a tiny CPU simulator in C.
  3. 7 Memory Types in a Microcontroller Learn the memory types inside a microcontroller (flash, SRAM, EEPROM, ROM, registers), what each is used for, how the address map is laid out, and how to budget them.
  4. 8 Clocks, Reset and Boot Learn how a microcontroller gets its clock (RC, crystal, PLL), what resets it (power-on, brown-out, watchdog), and what happens between reset and main().

Embedded C

  1. 9 Fixed-Width Types and Integer Pitfalls Use uint8_t, int32_t and friends correctly in embedded C: integer promotion, signed/unsigned traps, overflow, saturating math and fixed-point instead of float.
  2. 10 Bit Manipulation for Registers Master set, clear, toggle and test of register bits in C with masks and shifts, multi-bit fields, read-modify-write hazards and reusable macros, all runnable.
  3. 11 volatile, const and static in Embedded C Understand volatile for registers and ISR-shared variables, const for flash tables, static for lifetime and linkage, and how the optimizer can break code without them.
  4. 12 Structs, Unions, Bit-Fields and Endianness Model registers and protocol packets in C: struct padding and alignment, packed structs, unions for type punning, bit-field pitfalls and little vs big endian.
  5. 13 Macros, Inline Functions and Compile-Time Checks Write safe preprocessor macros, choose static inline functions, use enums, X-macros, conditional compilation and static_assert to catch embedded bugs at compile time.
  6. 14 State Machines in C Design embedded behavior as finite state machines: switch-based and table-driven implementations in C, events, actions, debouncing a button and a traffic light example.

Memory, Registers and Peripherals

  1. 15 Memory-Mapped Registers Learn how peripherals are controlled through memory-mapped registers: volatile pointers, register structs, base addresses, access types (RW, RO, W1C), and a simulated GPIO block.
  2. 16 GPIO in Depth Understand GPIO pin modes (input, push-pull, open-drain, alternate function), pull-up and pull-down resistors, active-low logic, drive strength and reading buttons correctly.
  3. 17 Startup Code, Linker Sections and the Stack See how a firmware image is laid out: text, rodata, data, bss, the vector table, a linker script, startup code, stack growth, overflow and measuring stack usage.
  4. 18 Static Allocation and Memory Pools Manage memory without malloc: static buffers, fixed-block memory pools, ring buffers for UART data, heap fragmentation and alignment, with runnable C examples.
  5. 19 ADC and PWM Basics Learn how a microcontroller reads analog voltages with an ADC (resolution, reference, sampling, filtering) and makes analog-like output with PWM (duty cycle, frequency, LEDs, servos).

Interrupts and Timers

  1. 20 Interrupts and Interrupt Service Routines Learn how microcontroller interrupts work: vector tables, priorities, nesting, latency, and how to write short interrupt service routines that hand work to main.
  2. 21 Timers, Counters and PWM Learn how hardware timers count clock ticks, how prescalers and reload values set the period, and how compare registers generate PWM signals for LEDs and motors.
  3. 22 Volatile, Atomicity and Shared Data in Interrupts Learn why shared variables need volatile, how torn reads happen, how critical sections protect multi-byte data, and how to build a lock-free ring buffer between an ISR and main.
  4. 23 Debouncing and Software Timers Learn why mechanical switches bounce, how to debounce with sampling counters, and how to build many software timers from one hardware tick with wraparound-safe time math.

Communication Buses

  1. 24 UART and Serial Communication Understand UART frames, baud rates and error flags, calculate baud divisors, and write a byte-wise packet parser with a checksum in embedded C.
  2. 25 The SPI Bus Learn how SPI works: master and slave shift registers, the four signals, clock polarity and phase modes, chip select, and a register read/write driver in embedded C.
  3. 26 The I2C Bus Learn how I2C works with only two wires: START and STOP conditions, 7-bit addresses, ACK and NACK, repeated start, pull-up resistor sizing and a bus scanner in C.
  4. 27 CAN, USB, 1-Wire and Other Embedded Buses Learn how CAN arbitration, bit stuffing and CRC work, get a short tour of USB, LIN, 1-Wire, Modbus and Ethernet, and see how to choose the right bus for a design.

RTOS and Scheduling

  1. 28 What Is an RTOS? Tasks, Ticks and Real-Time Learn what a real-time operating system does, why a super loop stops scaling, how tasks, priorities and the scheduler tick work, and how FreeRTOS-style code is organized.
  2. 29 Building a Cooperative Scheduler Build a simple cooperative scheduler for microcontrollers in C: periodic run-to-completion tasks, jitter from long tasks, and protothread-style non-blocking waits.
  3. 30 RTOS Synchronization: Queues, Semaphores and Mutexes Learn the RTOS tools for task communication: queues, binary and counting semaphores, mutexes and event flags, plus priority inversion, priority inheritance and deadlock.
  4. 31 Scheduling Algorithms and Deadline Analysis Compare round-robin, fixed-priority, rate-monotonic and earliest-deadline-first scheduling, compute CPU utilization and worst-case response times, and simulate deadline misses.

Debugging, Testing and Low Power

  1. 32 Debugging Embedded Systems Learn the embedded debugging toolbox: SWD and JTAG probes, breakpoints, logging, logic analyzers, hard fault analysis, stack high-water marks and defensive techniques like assert and watchdogs.
  2. 33 Testing Embedded Code Learn how to test firmware without hardware: separate logic from hardware, write host-side unit tests, use a fake HAL to test drivers, and know when to use simulators and hardware-in-the-loop.
  3. 34 Low-Power Design for Embedded Systems Learn how to make microcontroller devices last on a battery: sleep modes, wake-up sources, duty cycling, tickless idle, clock gating, and battery life calculations with C examples.

Projects and Practice

  1. 35 Project: Traffic Light Controller as a State Machine Build a traffic light controller with a table-driven finite state machine, a pedestrian request button and a safety test, in C that runs on a PC and ports to a microcontroller.
  2. 36 Project: Sensor Data Logger with Filtering and Alarms Build a temperature data logger in C: convert ADC counts with integer math, smooth noise with a moving average, add a hysteresis alarm, store samples in a ring buffer and send CRC-protected packets.
  3. 37 Embedded C Practice Problems with Solutions Practice embedded C with worked problems: bit manipulation, register fields, endianness, struct packing, integer promotion traps, fixed-point math and saturating arithmetic, plus challenges and interview questions.