Single-Slope PWM Operation

For single-slope PWM generation, the period time (T) is controlled by Top value, and CCx controls the duty cycle of the generated waveform output. When up-counting, the WO[x] is set at start or compare match between the COUNT and TOP values, and cleared on compare match between COUNT and CCx register values. When down-counting, the WO[x] is cleared at start or compare match between the COUNT and ZERO values, and set on compare match between COUNT and CCx register values.

Figure 1. Single-Slope PWM Operation

The following equation calculates the exact resolution for a single-slope PWM (RPWM_SS) waveform:


RPWM_SS=log(TOP+1)log(2)

The PWM frequency depends on the Period register value (PER) and the peripheral clock frequency (fGCLK_TCC), and can be calculated by the following equation:

fPWM_SS=fGCLK_TCCN(TOP+1)

Where N represents the prescaler divider used (1, 2, 4, 8, 16, 64, 256, 1024).