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.
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.
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 lowThe 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 |
|
| Reading a pinA 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 |
|
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".
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 portA 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 |
|
| PWM from a timerPA0 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 |
|
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".
Talking, and making it yours
USART1 both ways, then a blank page and six lamps.
| Lesson | Time | What students do |
|---|---|---|
| The board talks and listensUSART1 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 |
|
| Project: make the sweep yoursSix 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 |
|
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".
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.