Embedded on the ESP32-C3 lesson plan
A 32 bit RISC-V board at 160 MHz. Its own peripherals, its own 3.3 V rules, and a console at the end of it.
Objectives and materials
By the end, students can
- One pin, then six, and what a GPIO matrix is for.
- A pin that reads, and a handler that runs the moment it changes.
- UART0 both ways, and the start of every protocol.
- One unit of time, and everything else in proportion to it.
- PWM by hand, a filter that averages it, and what the peripheral would have cost.
- Seven segments, then a screen on two wires, then color on one.
- A memory game and a console, both on a breadboard.
Materials for the whole unit
- Addressable RGB LEDs
- Capacitor
- ESP32-C3-DevKitM-1
- Full-size breadboard
- LED x 6
- OLED display, 128x64
- Piezo speaker
- Pushbutton x 4
- Resistor x 6
- Seven segment display
- TFT display, 240x320
Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.
First light
One pin, then six, and what a GPIO matrix is for.
| Lesson | Time | What students do |
|---|---|---|
| First light on the C3One pin, one lamp, one program on a RISC-V board. Why 3.3 V changes the resistor you pick, and what the board does while it waits. | 50 min |
|
| Six pins and a moving dotAn array of pin numbers, a loop that walks it, and a sweep that bounces. The first sketch where the code shape matters more than the wiring. | 50 min |
|
Materials
- ESP32-C3-DevKitM-1
- Full-size breadboard
- LED x 6
- Resistor x 6
Check for understanding
Each student finishes "Six pins and a moving dot" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Where six pins stops working".
Reading the world
A pin that reads, and a handler that runs the moment it changes.
| Lesson | Time | What students do |
|---|---|---|
| Reading a pin at 3.3 VA button on GPIO 9 with the pad pull-up on. Why pressed reads low, what 45 k means, and what a floating input really does. | 50 min |
|
| Interrupts, and what they costA handler that runs the moment a pin falls, a counter shared with the main loop, and the bounce that makes one press count as four. | 50 min |
|
Materials
- ESP32-C3-DevKitM-1
- Full-size breadboard
- LED
- Pushbutton
- Resistor
Check for understanding
Each student finishes "Interrupts, and what they cost" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Debounce it, and know what it costs".
Talking to your computer
UART0 both ways, and the start of every protocol.
| Lesson | Time | What students do |
|---|---|---|
| The board talksUART0, the monitor, and the uptime. What a baud rate costs in time, and why printing a float works on a chip that cannot do arithmetic with one. | 50 min |
|
| The board listensCharacters arriving into a FIFO, read without blocking, and echoed back with their hex. The first half of every protocol you will ever write. | 50 min |
|
Materials
- ESP32-C3-DevKitM-1
- Full-size breadboard
Check for understanding
Each student finishes "The board listens" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "From echo to protocol".
Timing you can hear
One unit of time, and everything else in proportion to it.
| Lesson | Time | What students do |
|---|---|---|
| Timing you can hearMorse is timing and nothing else. One unit of time, five rules, a lamp and a piezo, and a button that moves to the next message. | 50 min |
|
Materials
- ESP32-C3-DevKitM-1
- Full-size breadboard
- LED
- Piezo speaker
- Pushbutton
- Resistor
Check for understanding
Each student finishes "Timing you can hear" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Change the speed".
Brightness
PWM by hand, a filter that averages it, and what the peripheral would have cost.
| Lesson | Time | What students do |
|---|---|---|
| Brightness without a PWM peripheralThe C3 has an LED PWM peripheral and Mokxi does not model it, so this sketch does it in software. Two lamps, one through a filter, and the cost of doing it by hand. | 50 min |
|
Materials
- Capacitor
- ESP32-C3-DevKitM-1
- Full-size breadboard
- LED x 2
- Resistor x 3
Check for understanding
Each student finishes "Brightness without a PWM peripheral" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "What it would cost in hardware".
Showing something
Seven segments, then a screen on two wires, then color on one.
| Lesson | Time | What students do |
|---|---|---|
| Showing a numberSeven LEDs in the shape of an eight, a table of digits, and a die that tumbles. Where a pin budget starts to hurt. | 50 min |
|
| A screen on two wiresA 128x64 OLED over I2C, bit-banged on two pins. Addresses, acknowledgments, a frame buffer in RAM, and what a redraw costs. | 50 min |
|
| Color on one wireSixteen addressable LEDs on a single pin, and a protocol where the length of a pulse is the bit. The timing is the whole problem. | 50 min |
|
Materials
- Addressable RGB LEDs
- ESP32-C3-DevKitM-1
- Full-size breadboard
- OLED display, 128x64
- Pushbutton
- Resistor
- Seven segment display
Check for understanding
Each student finishes "Color on one wire" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "What sixteen LEDs actually draw".
Two things to play
A memory game and a console, both on a breadboard.
| Lesson | Time | What students do |
|---|---|---|
| Project: a memory gameFour lamps, four buttons and a sequence that grows. State, arrays and input handling in one thing you can actually play. | 50 min |
|
| Project: a consoleA color TFT, two buttons and a piezo, running a game at forty frames a second. What a frame budget is and where it all goes. | 50 min |
|
Materials
- ESP32-C3-DevKitM-1
- Full-size breadboard
- LED x 4
- Piezo speaker
- Pushbutton x 4
- Resistor x 4
- TFT display, 240x320
Check for understanding
Each student finishes "Project: a console" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Make it your game".
Teach this unit as a class
Start a class from this course and its 13 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.
The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.