Output Control

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

The Compare x Enable (CMPxEN) bit field in the TCDn.FAULTCTRL register enables the different outputs. The CMPx bit filed in the TCDn.FAULTCTRL register sets the output values 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 (CMPCSEL and CMPDSEL) bits in the Control C (TCDn.CTRLC) register.

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

When used in One Ramp mode, WOA will only use the setup for DeadTime 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 the TCDn.FAULTCTRL register must be equal to CMPAVAL[0] and [2] in the TCDn.CTRLD register. If not, the first cycle after a Fault is detected can have the wrong polarity on the outputs. The same applies to CMPB in the TCDn.FAULTCTRL (and CMPC/D if WOC/D equals WOB) bit, which must be equal to CMPBVAL[0] and [2] in the TCDn.CTRLD register.

Due to the asynchronous nature of the TCD and that input events can immediately affect the output signal, there is a risk of nanosecond spikes occurring on the output without any 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 the direction of the CMPx values given by the TCDn.FAULTCTRL register.