23.3.3.4.1 Waveform Generation
The compare channels can be used for waveform generation on the corresponding port pins. The following requirements must be met to make the waveform visible on the connected port pin:
- A Waveform Generation mode must be selected by writing the Waveform Generation Mode (WGMODE) bit field in the TCAn.CTRLB register.
- The used compare channels must be
enabled (CMPnEN =
1
in TCAn.CTRLB), which will override 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. - The direction for the associated port pin n must be configured in the Port peripheral as an output.
- Optional: Enable the inverted waveform output for the associated port pin n. Refer to the PORT - I/O Pin Configuration section for details.