Clocks and RCC
A write to a port with its clock off is lost; the same write after RCC_AHB1ENR sticks. Then the PLL: PLLCFGR worked out for 84 MHz from the Black Pill’s 25 MHz crystal, and the switch to it, bit by bit.
Open it in the simulatorUnder the HAL on an STM32F411 Black Pill: the reference manual and its memory map, RCC and the PLL, GPIO registers, SysTick, a USART driver and timer PWM written by hand, and a cubesat Morse beacon with no driver but your own.
0 of 7 done
7 lessons in 4 chapters, about 7 hours on a simulated STM32F411 Black Pill. Free, in your browser, every step checked by the simulator.
A write to a port with its clock off is lost; the same write after RCC_AHB1ENR sticks. Then the PLL: PLLCFGR worked out for 84 MHz from the Black Pill’s 25 MHz crystal, and the switch to it, bit by bit.
Open it in the simulatorThe Cortex-M4’s own 24-bit timer, programmed directly: a reload for a 1 ms tick at 84 MHz, COUNTFLAG polled instead of an interrupt, the longest tick 24 bits allow, and an LED blinked by counting.
Open it in the simulatorTIM3 channel 1 on PA6 set up register by register: the prescaler to 1 MHz, ARR for a 1 kHz period, CCR1 for the duty, PWM mode 1 with preload, and a frequency counter checking the result while the LED breathes.
Open it in the simulatorEach lesson opens when the one before it is done, and each chapter ends in a project.
The reference manual, the memory map and the clock gates.
Every peripheral is a block of addresses. Read registers straight from RM0383’s memory map, find their reset values, watch a port read 0 until its clock is on, and blink the LED through a raw pointer.
0 of 7 steps
A write to a port with its clock off is lost; the same write after RCC_AHB1ENR sticks. Then the PLL: PLLCFGR worked out for 84 MHz from the Black Pill’s 25 MHz crystal, and the switch to it, bit by bit.
0 of 7 steps
GPIO registers and the Cortex-M SysTick.
The KEY button on PA0 with its pull-up set in PUPDR, read from IDR, and mirrored onto two LEDs through BSRR: one active low on PC13, one active high on PB12. MODER, PUPDR, IDR and BSRR, bit by bit.
0 of 7 steps
The Cortex-M4’s own 24-bit timer, programmed directly: a reload for a 1 ms tick at 84 MHz, COUNTFLAG polled instead of an interrupt, the longest tick 24 bits allow, and an LED blinked by counting.
0 of 6 steps
A USART driver and timer PWM, register by register.
USART1 with no Serial library: PA9 and PA10 to alternate function 7, BRR worked out for 115200 baud at 84 MHz, and bytes sent and received by polling TXE and RXNE. A whole driver in forty lines.
0 of 6 steps
TIM3 channel 1 on PA6 set up register by register: the prescaler to 1 MHz, ARR for a 1 kHz period, CCR1 for the duty, PWM mode 1 with preload, and a frequency counter checking the result while the LED breathes.
0 of 7 steps
A driver-free cubesat Morse beacon.
A driver-free device: RCC, GPIO, SysTick, USART1 and TIM3 programmed by hand, not one Arduino call. It keys a callsign in Morse as an 800 Hz tone and the LED, and takes a new message from the ground station.
0 of 8 steps
All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.
Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.
Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kitYes. All 7 lessons of Bare-metal STM32 are free and run in your browser, with nothing to install and no parts to buy before you start.
No. Every lesson runs on a simulated STM32F411 Black Pill with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.
About 7 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.
Each chapter ends in a project that puts it together: Clocks and RCC, SysTick and Timer PWM by hand.
With "The reference manual", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.