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. 1.A Waveform Generation mode must be selected by writing the Waveform Generation Mode (WGMODE) bit field in the TCAn.CTRLB register.
  2. 2.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.
  3. 3.The direction for the associated port pin n must be configured in the Port peripheral as an output.
  4. 4.Optional: Enable the inverted waveform output for the associated port pin n. Refer to the PORT - I/O Pin Configuration section for details.