STM32 Peripherals Tutorials
This page covers tutorials on the built-in peripherals of STM32 microcontrollers. Peripherals are the hardware modules inside the MCU that handle communication, timing, data conversion, and storage. Understanding how to configure and use them correctly is the foundation of any STM32 project.
Each series listed below focuses on a specific peripheral, starting from the basics and working through practical examples. The tutorials use STM32CubeIDE and CubeMX for configuration, with working code and project files available for download.
STM32 ADC Series
The STM32 ADC series covers how to use the Analog to Digital Converter peripheral on STM32 microcontrollers. Starting from a basic single channel read, the series works through more practical setups like multi-channel scanning, DMA based conversions, and using the ADC with timers for precise sampling. If you are working with sensors or any analog signal, this series covers what you need.
STM32 ADC Part 2 – Single Channel with Interrupt and DMA
STM32 ADC Part 3 – Multiple Channels with DMA Normal Mode
STM32 ADC Part 4 – Multiple Channels with DMA Circular Mode
STM32 ADC Part 5 – Read Multiple‑Channel without DMA
STM32 ADC Part 6 – ADC Conversion Time Explained
STM32 ADC PART 7 – ADC External Trigger Source Selection
STM32 ADC Part 8 – Injected Conversion Mode
STM32 ADC Part 9 – ADC Hardware Oversampling Technique
STM32 ADC Part 10 – How to use ADC Reference Voltage
STM32 ADC Part 11 – How to use ADC in Differential Mode
STM32 Timer Series
The STM32 Timer series covers one of the most versatile peripherals on the STM32. Starting from basic timer configuration, the series works through practical use cases like generating delays, PWM output, input capture for frequency measurement, and encoder mode for motor control. Timers are used in almost every embedded project in some form, so this is a series worth going through regardless of what you are building.
STM32 Timers (Part 1): Generate PWM Signal with DMA using HAL
STM32 Timers (Part 2): How to Measure PWM Input Signal
STM32 Timers (Part 3): How to use the Timer Encoder Mode
STM32 Timers (Part 4): Input Capture Tutorial | Measure Frequency & Pulse Width
STM32 Timers (Part 5): STM32 Timer Synchronization Using Slave Trigger Mode
STM32 Timers (Part 6): Timer Synchronization for 3-Phase PWM Generation
STM32 Timers (Part 7): Timer synchronization using Slave Reset mode
STM32 Timers (Part 8): How to Create a 48-Bit Counter by Cascading Timers
STM32 Timers (Part 9): One Pulse Mode (OPM) – Generate Precise Triggered Pulses with Delay and Width Control
STM32 Timers (Part 10): Timer in Gated Mode ‒ Control PWM and Counter with External Signals
STM32 UART Series
The STM32 UART series covers serial communication on STM32 microcontrollers. Starting from basic transmit and receive, the series works through more practical implementations like interrupt based communication, DMA transfers, and handling variable length data. UART is one of the most commonly used interfaces for debugging, communicating with other devices, and building command line interfaces, so it is a good peripheral to get comfortable with early on.
STM32 UART Part 1 – Configure and Transmit Data in Blocking Mode
STM32 UART Part 2 – Transmit using DMA & Interrupt
STM32 UART Part 3 – Receive Data in Blocking & Interrupt mode
STM32 UART Part 4 – How to Receive Data using UART DMA
STM32 UART Part 4 – Receive Data Using IDLE Line (Interrupt & DMA Methods)
STM32 UART Part 6 – Half-Duplex Communication (Single-Wire Mode)
STM32 UART Part 7 – How to use one-Wire Protocol
STM32 UART Part 8 – LIN Communication Tutorial
STM32 I2C Slave Series
The STM32 I2C Slave series covers how to configure an STM32 as an I2C slave device. Most tutorials focus on the master side, reading sensors and external modules, but there are plenty of situations where you need the STM32 itself to act as a slave, for example when communicating with another microcontroller or a single board computer like a Raspberry Pi. This series covers the slave configuration from scratch and works through practical examples of sending and receiving data in slave mode.
STM32 as I2C SLAVE || PART 1
STM32 as I2C SLAVE || PART 2
STM32 as I2C SLAVE || PART 3
STM32 as I2C SLAVE || PART 4
STM32 as I2C SLAVE || PART 5
STM32 as I2C SLAVE || PART 6
STM32 as I2C SLAVE || PART 7
STM32 USB Series
The STM32 USB series covers how to use the built-in USB peripheral on STM32 microcontrollers. Starting from basic USB device configuration, the series works through common use cases like CDC virtual COM port for serial communication over USB, HID for keyboard and mouse emulation, and mass storage for reading and writing files. USB is a widely used interface and having it working directly on the STM32 removes the need for an external USB to UART converter in many projects.
