20.3.3.4.1 Waveform Generation
The compare channels can be used for waveform generation on the corresponding port pins. To make the waveform visible on the connected port pin, the following requirements must be met:
- A Waveform Generation mode must be selected by writing the WGMODE bit field in TCAn.CTRLB.
- The TCA is counting clock ticks, not events (CNTEI=0 in TCAn.EVCTRL).
- The compare channels used must be enabled (CMPnEN=1 in TCAn.CTRLB). This will override the corresponding port pin output register. An alternative pin can be selected by writing to the respective TCA Waveform Output n bit (TCA0n) in the Control C register of the Port Multiplexer (PORTMUX.CTRLC).
- The direction for the associated port pin n must be configured as an output (PORTx.DIR[n]=1).
- Optional: Enable inverted waveform output for the associated port pin n (INVEN=1 in PORTx.PINn).