EMBEDDED C · 24 lessons
8051·STM32 register-level — no HAL, Keil μVision simulator
24 lessons of register-level embedded C with no HAL — SFR·CMSIS, GPIO·timer·interrupt·UART·ADC·PWM, plus debouncing·ring buffer·HAL abstraction·capstone. Verified with PC gcc and the μVision simulator.
Part 1: Foundations (shared — verified with PC gcc)
5 lessons
Getting Started with Embedded C and Keil μVision
Embedded C, the `while(1)` skeleton and the build/debug flow
Data Types, Number Bases, stdint & sizeof
Exact bit widths and `uint8/16/32_t`
Bit Operations & Register Manipulation
set/clear/toggle and bit masks
Pointers, volatile & Memory-Mapped I/O
Registers as addresses and the role of `volatile`
Functions, Header Files & #define Macros
Modularity and header guards
Part 2: 8051 (Keil C51 / AT89C52)
7 lessons
8051 Architecture, SFRs & reg52.h
SFRs and `sbit`/`sfr`
GPIO Output — Blinking an LED
Port output and active-low wiring
GPIO Input — Buttons & Switches
Reading quasi-bidirectional ports
Timer 0/1 & Delays
Hardware timers
External & Timer Interrupts
`interrupt N`
UART Serial Communication
Serial transmit and receive
7-Segment Display (Multiplexing)
Lookup tables and dynamic driving
Part 3: STM32 (Keil MDK-ARM / STM32F103C8, direct register control)
8 lessons
Cortex-M, CMSIS & the Clock Tree
CMSIS, RCC and the clock tree
LED with RCC & GPIO Registers
CRL/CRH and ODR/BSRR
GPIO Input, Pull-up/Pull-down
IDR and internal pull-ups
SysTick Timer & Precise Delays
`SysTick_Config` and millisecond ticks
General-Purpose Timers & PWM Output
PSC/ARR/CCR and PWM
NVIC Interrupts & EXTI
EXTI and clearing pending flags
USART Serial Communication
BRR and TXE/RXNE
ADC Analog Input
12-bit conversion and scaling
Part 4: Applications & Patterns
4 lessons
Debouncing & Finite State Machines
Shared application patterns
Ring Buffers & Interrupt-Driven UART Reception
Shared application patterns
HAL Abstraction, Module Separation & Portability
Shared patterns, plus the Arduino Uno/AVR extension
Capstone — Control LEDs & Timers over UART Commands
MDK capstone