SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
There are 4 DPWM modules, 0-3. Each DPWM module has 4 fault inputs, CLIM, AB, A, and B.
There are 3 fault Mux registers for each DPWM:
Programming these registers is very simple. There is a bit for each fault detection source in each register. Setting it connects that fault detection source to the fault input and DPWM for that register. Here is an example:
FaultMuxRegs.DPWM0FLTABDET.bit.ACOMP_B_EN = 1;
// Connect analog comp B to DPWM0 fault input AB
Controlling the A and B fault inputs in the same register works like this:
FaultMuxRegs.DPWM0FAULTDET.bit.PWMA_ACOMP_B_EN = 1;
//Connect analog comparator B to DPWM0 fault A
FaultMuxRegs.DPWM0FAULTDET.bit.PWMB_ACOMP_B_EN = 1;
//Connect analog comparator B to DPWM0 fault B
Almost any fault detection circuit can be connected to any fault input on any DPWM. The only exception is the Analog Peak Current mode, which can only be connected to the CLIM fault input:
FaultMuxRegs.DPWM0CLIM.bit.ANALOG_PCM_EN = 1;