Source: https://mokxi.com/teachers/plans/embedded-stm32f411
Updated: 2026-11-11

Lesson plan

# Embedded on the STM32F411 lesson plan

A Cortex-M4 at 84 MHz, where a pin is a port and a number and every peripheral starts with its clock switched off.

3 chapters, 6 lessons, about 6 hours, on the STM32F411 Black Pill. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## Objectives and materials

### By the end, students can

- Active low wiring, a button, and what one line of Arduino is hiding.
- Six pins on one port, and a timer that holds a brightness for you.
- USART1 both ways, then a blank page and six lamps.

### Materials for the whole unit

- Full-size breadboard
- LED x 6
- Pushbutton
- Resistor x 6
- STM32F411 Black Pill

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.

Chapter 1. About 2 h

## The board

Active low wiring, a button, and what one line of Arduino is hiding.

Lesson | Time | What students do

The LED that is on when the pin is low The Black Pill wires its LED between the rail and the pin, so the pin has to go low to light it. Active low, and why so much hardware is built that way. | 60 min

- Wired the other way around
- Run it
- The lamp you wired
- Catch it low
- Blink it faster
- What one line of Arduino is hiding

Reading a pin A button on PB0 with the pull-up on, lighting an active low lamp. Two inversions in one circuit, and how to stop them confusing you. | 60 min

- Two inversions at once
- Watch the input
- And the output
- And the lamp
- Turn it round
- What EXTI would give you

### Materials

- LED
- Pushbutton
- Resistor
- STM32F411 Black Pill

### Check for understanding

Each student finishes "Reading a pin" 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 EXTI would give you".

Chapter 2. About 2 h

## Ports and timers

Six pins on one port, and a timer that holds a brightness for you.

Lesson | Time | What students do

Six pins on one port A dot along PA1 to PA6, from an array of pin numbers. What a port is, and why six pins on the same one can be written in a single instruction. | 60 min

- A pin is a port and a number
- Run it
- All the way along
- Watch a pin in the middle
- Slow it down
- What a pin can be instead

PWM from a timer PA0 is TIM5 channel 1, and once it is set up the hardware holds the brightness on its own. Prescaler, reload, and the compare value. | 60 min

- The three numbers behind analogWrite
- Run it and watch it breathe
- What the core is doing meanwhile
- What 0 and 255 really do
- Make the breath faster
- Where else a timer goes

### Materials

- Full-size breadboard
- LED x 6
- Resistor x 6
- STM32F411 Black Pill

### Check for understanding

Each student finishes "PWM from a timer" 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 else a timer goes".

Chapter 3. About 2 h

## Talking, and making it yours

USART1 both ways, then a blank page and six lamps.

Lesson | Time | What students do

The board talks and listens USART1 on PA9 and PA10, the monitor, and an echo driven from a receive interrupt. What printing costs and why the receive side is different. | 60 min

- Nothing is wired, and that is the circuit
- Say hello
- A floating point unit, left unused
- The uptime, from SysTick
- Type something
- What printing costs

Project: make the sweep yours Six lamps and a blank page. Rewrite the sweep around the clock, count what it does, and measure how long your own loop takes. | 60 min

- What you have to work with
- Take the delays out
- Add the thing it could not do before
- Change the pattern
- Measure yourself
- What you would reach for next

### Materials

- Full-size breadboard
- LED x 6
- Resistor x 6
- STM32F411 Black Pill

### Check for understanding

Each student finishes "Project: make the sweep yours" 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 you would reach for next".

Your class

## Teach this unit as a class

Start a class from this course and its 6 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.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Build a vending machine 6 lessons, about 5 h. Every unit All the courses as ready-made units, on the teachers page.
