PWM Overview & History

PWM (Pulse Width Modulation) is a technique used by microcontrollers to simulate analog output using digital signals. It has been widely adopted since the 1980s for motor control, LED dimming, power regulation, and audio signal generation.

PWM Technical Function

Microcontrollers generate PWM by rapidly switching a digital output on and off:

  1. The timer module or counter generates a repetitive period signal.
  2. The duty cycle is set by comparing the timer value with a threshold.
  3. When the timer is below the threshold, the output is high; otherwise, it is low.
  4. Changing the threshold adjusts the width of the high pulse, effectively controlling average voltage.
  5. For motors or LEDs, this controls speed or brightness smoothly despite digital switching.

PWM Diagram

PWM signal showing varying duty cycles over time