On-Chip Peripherals & Interrupts
GPIO, timers, PWM, ADC, DAC, DMA, interrupts and clocks. Programming the hardware inside the MCU: GPIO, timers and counters, PWM, ADC/DAC, DMA, the NVIC and interrupt design, clock trees, reset and watchdogs, and register-level peripheral programming.
- GPIO, Timers & Interrupts — The first peripherals every embedded engineer masters. Learn GPIO modes (push-pull, open-drain, pull-ups, alternate function), drive strength and input thresholds, button debouncing, external interrupts (EXTI) with edge selection, timers for delays, periodic ticks, input capture (frequency/pulse measurement) and output compare.
- ADC, PWM & DMA — Three peripherals that connect MCUs to the analog world efficiently. Learn MCU ADC configuration (sampling time, resolution, scan and continuous modes, triggers), PWM generation (frequency vs resolution trade-off, duty, complementary outputs), PWM-as-DAC filtering, and DMA with circular double buffers.
- ADC & DAC Converter Theory — Converters bridge analog and digital worlds. Learn resolution, LSB size, quantisation error and SNR, ADC types (flash, SAR, sigma-delta, pipelined), sampling rate, reference voltage, DAC types (R-2R, string, PWM), and key specs (INL, DNL, ENOB).
- Interrupt Fundamentals — Interrupts let hardware get the processor's attention immediately. Learn polling vs interrupts, the interrupt sequence (save context, vector, ISR, return), vectored and priority interrupts, maskable vs non-maskable, the 8085/8086 schemes, the ARM NVIC, latency, nesting, and writing safe interrupt service routines.
- NVIC, Interrupts & ISR Design — Interrupts let hardware demand the CPU's attention instantly. Learn the Cortex-M exception model and vector table, the NVIC (enable, pending, priority, grouping, preemption), automatic stacking and latency, tail-chaining and late arrival, writing correct ISRs, sharing data safely with volatile, critical sections and lock-free ring buffers, and how to budget interrupt CPU load.
- Clocks, Reset & Watchdog Timers — Before any peripheral works, the MCU needs a clock and a clean reset. Learn clock sources (HSI, HSE crystal, LSI, LSE), PLL configuration, bus prescalers and Flash wait states, clock gating, reset sources and brown-out detection, and independent and window watchdogs — including how to size timeouts and design a watchdog strategy that really catches failures.
- Peripheral Programming — Writing firmware that controls MCU peripherals. Learn memory-mapped registers and bit manipulation, read-modify-write and atomic access, polling vs interrupts vs DMA, peripheral initialisation patterns, datasheet and reference-manual reading, hardware abstraction layers, and debugging with logic analysers.