31.6.2.5.8 Output Polarity

The polarity (WAVE.POLx) is available in all waveform output generation. In single-slope and dual-slope PWM operation, it is possible to invert the pulse edge alignment individually on start or end of a PWM cycle for each compare channels. The table below shows the waveform output set/clear conditions, depending on the settings of timer/counter, direction, and polarity.

Table 31-3. Waveform Generation Set/Clear Conditions
Waveform Generation operationDIRPOLxWaveform Generation Output Update
SetClear
Single-Slope PWM00Timer/counter matches TOPTimer/counter matches CCx
1Timer/counter matches CCTimer/counter matches TOP
10Timer/counter matches CCTimer/counter matches ZERO
1Timer/counter matches ZEROTimer/counter matches CC
Dual-Slope PWMx0Timer/counter matches CC when counting upTimer/counter matches CC when counting down
1Timer/counter matches CC when counting downTimer/counter matches CC when counting up

In Normal and Match Frequency, the WAVE.POLx value represents the initial state of the waveform output.