Skip to main content


Showing posts from November, 2018

High Resolution PWM Signal Generation for RC Servos With STM32

Currently, I'm building an RC transmitter/receiver based on the SX1280 RF chip. One of the goal for the project is that I want 12 bit servo resolution from the sticks all away down to the servos. Partly because modern digital servos have 12 bit resolution secondly a high-end transmitter is using 12 bits anyway. I was investigating how I can generate high resolution PWM signals on STM32 devices. I'm using black pill (STM32F103C8T8) at the moment for the prototype.

Any STM32F103 development board (blue pill, black pill, etc.) A USB power bank as power supply STM32 programmer (Segger j-links, ST-LINK/V2, or simply an st-link clone) Software
STM32CubeMXAtollic TrueSTUDIO for STM32Project source from github The Obvious Solution
Probably the easiest solution is to use one of the timer which can generate PWM signals, like TIM1-3 on an STM32F103. For a modern digital servo the frame rate can go down to 5 ms or so, but for an old analog servo it should be 20 ms or 50 Hz. So…