Skip to content

19 hands-on embedded C++ lessons across ESP32, STM32, AVR & Raspberry Pi Pico - runnable in-browser via Wokwi simulator

License

Notifications You must be signed in to change notification settings

SolidRegardless/embedded-learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gate Allocation Engine

19 Lessons 4 Platforms Wokwi MIT License

🔌 Embedded C++ Learning Path

A hands-on, zero-hardware curriculum for learning embedded systems programming.

19 progressive lessons across 4 microcontroller platforms — all runnable in your browser using the free Wokwi simulator. No dev boards, no soldering, no toolchain headaches. Just code, circuits, and deeply annotated explanations.

The comments in the code ARE the lesson. Each sketch explains not just what the code does, but why — down to the register level, with cross-platform comparisons throughout.


🚀 Getting Started

  1. Head to wokwi.com and create a new project
  2. Select the board for your lesson (ESP32 · STM32 Nucleo · Arduino Uno · Raspberry Pi Pico)
  3. Paste the lesson's sketch.ino into the code editor
  4. Switch to the diagram tab and paste diagram.json
  5. Hit Play ▶ and start learning

No account required. No installs. Works on any machine with a browser.


📚 Curriculum

🟢 ESP32 — The IoT Workhorse

Xtensa LX6 · 240 MHz · Dual Core · WiFi + Bluetooth · 520 KB SRAM

# Lesson Concepts
01 Blink GPIO output · register-level vs Arduino abstractions · timing
02 Button + LED GPIO input · pull-up resistors · debouncing · non-blocking timing
03 Serial / UART UART protocol · baud rate · ADC · command parsing
04 PWM LED Pulse Width Modulation · duty cycle · LEDC peripheral
05 I2C Sensor I2C bus · device addresses · DHT22 temperature/humidity
06 Interrupts Hardware interrupts · ISRs · volatile · IRAM_ATTR · critical sections

🔵 STM32 — The Industry Standard

Cortex-M0+ · 48 MHz · Clock Gating · HAL/LL Drivers · AHB/APB Bus

# Lesson Concepts
07 GPIO & HAL HAL vs direct registers · clock tree · MODER/BSRR · peripheral clocks
08 Timers & PWM Hardware timers · prescaler/ARR/CCR · capture/compare · encoder mode
09 ADC with DMA DMA transfers · scan mode · continuous conversion · zero-CPU-cost sampling
10 I2C OLED I2C on STM32 · SSD1306 display · address scanning · raw byte commands

🟡 AVR (Arduino Uno) — The Bare-Metal Classic

ATmega328P · 8-bit · 16 MHz · 2 KB RAM · 32 KB Flash

# Lesson Concepts
11 Port Manipulation DDRx/PORTx/PINx registers · bitwise ops · single-cycle I/O
12 Timer Interrupts Timer1 CTC mode · prescalers · OCR1A · precise periodic interrupts
13 EEPROM Non-volatile storage · wear levelling · 100K write-cycle endurance
14 Watchdog Timer WDT reset · hang recovery · WDTCSR · production reliability

🟣 Raspberry Pi Pico — The Modern Newcomer

RP2040 · Dual Cortex-M0+ · 133 MHz · PIO · 264 KB SRAM

# Lesson Concepts
15 Dual Core Multicore execution · setup1()/loop1() · hardware FIFO mailbox
16 PIO Programmable I/O state machines · WS2812 NeoPixels · custom protocols
17 ADC & Temp Sensor Built-in temperature sensor · 12-bit ADC · oversampling techniques
18 PWM Slices 8 hardware PWM slices · RGB LED · HSV colour cycling

🔴 Cross-Platform Capstone

# Lesson Concepts
19 Comparison The same task on all four platforms — GPIO, debounce, interrupts, timing, and memory models compared side-by-side

🧠 What You'll Learn

By the end of this curriculum, you'll understand:

  • GPIO — How pins physically switch between voltage levels
  • Registers — Reading/writing hardware control registers directly
  • Communication protocols — UART, I2C, SPI fundamentals
  • Interrupts — Hardware event handling without polling
  • Timers & PWM — Precise timing, waveform generation, motor/LED control
  • DMA — Offloading data transfers from the CPU
  • Memory constraints — Working within 2 KB RAM (AVR) to 520 KB (ESP32)
  • Multicore — Parallel execution on dual-core MCUs
  • PIO — Custom hardware I/O protocols (RP2040)
  • Watchdog & EEPROM — Production reliability and persistence
  • Platform differences — Why the same task looks different on ARM vs AVR vs Xtensa

🏭 Industry Platforms Not Covered

These MCU families are critical in industry but aren't available in Wokwi:

Platform Why It Matters
Nordic nRF52/53/91 Dominant in Bluetooth Low Energy — wearables, asset trackers, hearing aids. nRF9160 adds cellular (LTE-M/NB-IoT).
TI MSP430 Ultra-low-power king — µA-level consumption for battery-powered metering, medical devices, and energy harvesting.
Microchip PIC Decades of legacy across 8/16/32-bit families — automotive, appliances, industrial control. Billions shipped.
NXP LPC / i.MX RT Automotive (CAN/LIN), NFC/RFID, and high-performance real-time. i.MX RT crossover processors blur the MCU/MPU line.
Renesas RA/RX/RL78 #1 MCU vendor by automotive market share. Cortex-M based RA family. Ubiquitous in Japanese automotive and industrial.

🤝 Contributing

Found a bug in a diagram? Want to add a lesson for a new peripheral? PRs are welcome.

Each lesson should follow the established format:

  • sketch.ino — Heavily commented code (the comments are the lesson)
  • diagram.json — Valid Wokwi circuit diagram
  • One clear concept per lesson, building on previous ones

📄 License

MIT License — see LICENSE for details.

Created by Stuart Hart — built as an open educational resource for anyone learning embedded systems.


From blinking an LED to programming hardware state machines — one lesson at a time.

About

19 hands-on embedded C++ lessons across ESP32, STM32, AVR & Raspberry Pi Pico - runnable in-browser via Wokwi simulator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages