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 fulfilled:
- A waveform generation mode must be
selected by writing the WGMODE bit field in TCA.CTRLB.
- The TCA is counting clock tick, not
Events (CNTEI=0 in TCA.EVCTRL)
- The compare channels used must be
enabled (CMPnEN=1 in TCA.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 output (PORT.DIR[n]=1).
- Optional: Enable inverted waveform
output for the associated Port pin n (INVEN=1 in PORT.PINn).