Introduction to PWM (Pulse Width Modulation)

PWM or Pulse Width Modulation is the microcontroller's way of creating variable voltages. Since the microcontroller can only create voltages of 0v and the voltage of VCC which could be 5v, 3.3v, 1.8v, etc. there is a need to be able to create voltages between this 0v and VCC to control devices that required these variable voltages. Some of the uses are: - Sound output - Motor control - LED Dimming The components to PWM is the Pulse, the Period and the Duty Cycle. The pulse is where the voltage reaches 5v and maintains this 5v within the set period. The period is the time frame that there is an idle voltage 0v, and a pulse. The period is set to the specifications of the desired resolution. The duty cycle is the percentage of the width of the pulse in relation to the period. There is standard PWM where the pulse falls at one side of the period, and there is phase correct PWM where the pulse falls at the midpoint of the period.



Back to blog

Leave a comment

Please note, comments need to be approved before they are published.