22.3.2.7 Output Control

The outputs are configured by writing to the Fault Control register (TCDn.FAULTCTRL). TCDn.FAULTCTRL is only reset to '0' after a POR reset. During the reset sequence after any Reset, TCDn.FAULTCTRL will get its values from the TCD Fuse (FUSE.TCDCFG).

The Compare x Enable bits (CMPxEN in TCDn.FAULTCTRL) enable the different outputs. The CMPx bits in TCDn.FAULTCTRL set the value the registers should have after Reset or when a fault is triggered.

The TCD itself generates two different outputs, WOA and WOB. The two additional outputs WOC and WOD can be configured by software to be connected to either WOA or WOB by writing the Compare C/D Output Select bits (CMPCSEL and CMPDSEL) in the Control C register (TCDn.CTRLC).

The user can also override the outputs based on the TCD counter state by writing a '1' to the Compare Output Value Override bit in the Control C register (CMPOVR in TCDn.CTRLC). The user can then select the output values in the different dead- and on-times by writing to the Compare x Value bit fields in the Control D register (CMPAVAL and CMPBVAL in TCDn.CTRLD).

When used in One Ramp mode, WOA will only use the setup for Dead-Time A (DTA) and On-Time A (OTA) to set the output. WOB will only use Dead-Time B (DTB) and On-Time B (OTB) values to set the output.

When using the override feature together with faults detection (input modes) the CMPA (and CMPC/D if WOC/D equals WOA) bit in TCDn.FAULTCTRL should be equal to CMPAVAL[0] and [2] in CTRLD if not the first cycle after a fault is detected can have the wrong polarity on the outputs. The same applies to CMPB in TCDn.FAULTCTRL (and CMPC/D if WOC/D equals WOB) bit, which should be equal to CMPBVAL[0] and [2] in TCDn.CTRLD.

Due to the asynchronous nature of the TCD, that input events immediately can affect the output signal, there is a risk of nano-second spikes occurring on the output when there is no load on the pin. The case occurs in any Input mode different from '0' and when an input event is triggering. The spike value will always be in direction of the CMPx value given by the TCDn.FAULTCTRL register.