Overview, PWM signal generation through timer in STM32, STM32 configuration with STCube, Basic configuration, Timer 2 configuration, The initialization code, Dimming LED, PWM stands for Pulse-Width Modulation. Once the switching frequency (fsw) has been chosen, the ratio between the switch-on time (TON) and the switch-off time (TOFF) is varied. This is commonly called duty-cycle (D). The duty cycle can be between 0 and 1 and is generally expressed as a percentage (% ...