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:

  1. A Waveform Generation mode must be selected by writing the WGMODE bit field in TCAn.CTRLB.
  2. 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.
  3. The direction for the associated port pin n must be configured as an output (PORTx.DIR[n] = 1).
  4. Optional: Enable the inverted waveform output for the associated port pin n (INVEN = 1 in PORTx.PINnCTRL).