STM32 Programming· Live

What PWM is, and how a timer makes it

Video lesson · in the full course

PWM (pulse width modulation) switches a pin on and off very fast. The share of time it is on, the duty cycle, sets the average power: how bright an LED is, or how fast a motor turns. A timer makes the signal with no work from the CPU.

What this lesson covers

  • Where PWM is used: motors, power supplies, LEDs, servos, audio
  • Frequency and duty cycle
  • How the counter, CCR and ARR make the signal
  • The two formulas you need

By the end, you can work out the timer settings for any PWM frequency and duty cycle with two short formulas.

The full course has the video, every step with screenshots, the code with a copy button, and the checks and fixes. $20 once unlocks this lesson, the other 7 full-course lessons and 36 bonus lessons, and you can ask me questions under each one. Checkout on steppeschool.com; 14-day money-back guarantee.