4 PWM Mode

Pulse-Width Modulation (PWM) is a scheme that controls power to a load by switching quickly between fully active and fully inactive states. The PWM signal resembles a square wave where the high portion of the signal is considered the active state while the low portion of the signal is considered the inactive state. The high portion, also known as the pulse-width, can vary in time and is defined in steps. A larger number of steps applied, which lengthens the pulse-width, also supplies more power to the load. Lowering the number of steps applied, which shortens the pulse-width, supplies less power. The PWM period is defined as the duration of one complete cycle or the total amount of active and inactive time combined.

PWM resolution defines the maximum number of steps present in a single PWM period. A higher resolution allows for more precise control of the pulse-width time and, in turn, the power that is applied to the load.

The term duty cycle describes the proportion of the active time to the inactive time and is expressed in percentages, where 0% is fully inactive and 100% is fully active. A lower duty cycle corresponds to less power applied while a higher duty cycle corresponds to more power applied. The figure below shows a typical waveform of the PWM signal.

Figure 4-1. CCP PWM Output Signal