34.6.2.5.5 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 34-6. Single-Slope PWM Operation

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


R PWM_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:

f PWM_SS = f GCLK_TCC N(TOP+1)

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