23.3.4.4.1 Waveform Generation

The compare channels can be used for waveform generation on the corresponding port pins. The following requirements are mandatory to make the waveform visible on the connected port pin:

  1. Select a Waveform Generation mode by writing the Waveform Generation Mode (WGMODE) bit field in the TCEn.CTRLB register.
  2. Enable the used compare channels (CMPnEN = ‘1’ in TCEn.CTRLB), thus overriding the output value for the corresponding pin. An alternative pin can be selected by configuring the Port Multiplexer (PORTMUX). Refer to the PORTMUX - Port Multiplexer section for details.
  3. Optional: Enable the inverted waveform output for the associated port pin n. Refer to the PORT - I/O Pin Configuration section for details.
Table 23-2. Timer Waveform Generation Mode
WGMODE[2:0]Group ConfigurationMode of OperationTopUpdateOVF
000NORMALNormalPERTOP/BOTTOM(1)TOP/BOTTOM(1)
001FRQFrequencyCMP0TOP/BOTTOM(1)TOP/BOTTOM(1)
010-Reserved---
011SINGLESLOPESingle-Slope PWMPERBOTTOMBOTTOM
100-Reserved---
101DSTOPDual-Slope PWMPERBOTTOMTOP
110DSBOTHDual-Slope PWMPERBOTTOMTOP and BOTTOM
111DSBOTTOMDual-Slope PWMPERBOTTOMBOTTOM
Note: TOP for up-count and BOTTOM for down-count.