24.3.1 Initialization
- Enable waveform extension mode in the Control A (WEXn.CTRLA) register
- Enable the Dead Time Units by writing a ‘
1
’ to the DTInEN bits. Enable the Pattern Generation mode by writing a ‘1
’ to the PGM bit. Configure the Input Matrix (INMX[2:0]) bit field to the desired input mode for the WEX peripheral.
- Enable the Dead Time Units by writing a ‘
- Optional: Enable Dead Time settings
- Write Dead Time settings in the Dead-time Low Side (WEXn.DTLS)/High Side (WEXn.DTHS) or Dead-time Low Side Buffer (WEXn.DTLSBUF)/High Side Buffer (WEXn.DTHSBUF) registers
- Optional: Enable output swapping by writing to the DTI Swap (WEXn.SWAP) and/or DTI Swap Buffer (WEXn.SWAPBUF) registers
- Optional: Configure pattern generation in the Pattern Generation Mode Override (WEXn.PGMOVR) and the Pattern Generation Mode Output (WEXn.PGMOUT) registers, and their respective buffer (WEXn.PGMOVRBUF and WEXn.PGMOUTBUF) registers
- Configure blanking in the Blanking Control (WEXn.BLANKCTRL) and Blanking Time (WEXn.BLANKTIME) registers
- Optional: Enable fault control
- Set fault mode in the Fault Control (WEXn.FAULTCTRL) register by changing the Fault Detection Restart Mode (FDMODE) bit
- Set fault action in the WEXn.FAULTCTRL register by changing the Fault Detection Action (FDACT[1:0]) bit field
- Configure the pin drives and fault output values in the Fault Drive (WEXn.FAULTDRV) and Fault Output (WEXn.FAULTOUT) registers
- Write the FAULTSET Command to the Control C (WEXn.CTRLC) register to ensure pins are in a fault state
- Enable overriding the output pins in the Output Override Enable (WEXn.OUTOVEN) register. The pins will now be in the fault state if a fault is detected.
The Waveform Extension will start operating when an input waveform is connected and running.
In case a fault is detected:
- Configure the fault generators and the Event System
- Enable fault inputs in the Event Control A/B/C (WEXn.EVCTRLA/B/C) registers