20.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 WGMODE bit field in TCAn.CTRLB.
- The compare channels used must be
enabled (CMPnEN =
1
in TCAn.CTRLB). This 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 chapter for details. - The direction for the associated port
pin n must be configured as an output (PORTx.DIR[n] =
1
). - Optional: Enable the inverted waveform output for the
associated port pin n (INVEN =
1
in PORTx.PINnCTRL).