PWM Counter and Clocks
53
SNIU028A – February 2016 – Revised April 2016
Copyright © 2016, Texas Instruments Incorporated
Digital Pulse Width Modulator (DPWM)
Dpwm0Regs.DPWMEV2.bit.EVENT2 = 40000; //both forms are the same
Dpwm0Regs.DPWMSAMPTRIG1.all = 40000; //includes 6 unused lsbs
Dpwm0Regs.DPWMSAMPTRIG1.bit.SAMPLE_TRIGGER = 625;
//needs to be divided by 64 for 6 bits
The adaptive sample and resonant duty registers do not follow the standard bit alignment. Their least
significant bits are worth 16 nanoseconds and 4 nanoseconds respectively.
2.13 PWM Counter and Clocks
The PWM counter is the center of the DPWM logic. There is no register that can be read to give the value
of the PWM counter, but most events are triggered by it. In all modes it is allowed to count up to the
period value, and then restarted at zero. Since it restarts at zero, the period is technically equal to
1. So in the example above, the number should really be 2499. Generally the error is
unimportant. In all modes but the resonant modes, the period is a fixed value. In the resonant modes, the
period comes from the output of a Filter.
The PWM counter is also restarted by the receipt of a sync signal (if sync is enabled), as shown above in
.
Sync signals received exactly at the end of the period run very smoothly. Sync signals received at other
times during the period will restart the counter and the period. The effects of this should be taken into
consideration for each application.
Even though the period register has only 14 bits, the PWM counter effectively has 18 bits. Each 4
nanosecond period is subdivided into 16 intervals, nominally 250 picoseconds long. The extra 4 bits
representing these intervals are called “high resolution bits”.
2.14 DPWM Registers - Overview
This section discusses each DPWM register, with examples of their use where appropriate. In addition, it
interacts with many other peripherals, parts of which are also described below.
2.15 DPWM Control Register 0 (DPWMCTRL0)
The DPWM Control Register 0 is one of 3 DPWM control registers which configure the DPWM. All 3
registers control a variety of DPWM functions. It is not possible to draw a clear dividing line between the 3
registers.
2.15.1 DPWM Auto Config Mid and Max Registers
There are two other registers – DPWMAUTOMAX and DPWMAUTOMID, which have many of the same
bits as control register 0.
These two Auto Mode Switching (AMS) registers are used in topologies where the DPWM mode changes
automatically as the filter output changes, such as resonant and phase shifted full bridge. See
on the auto switch level registers for more information on mode switching.
Not all bits in DPWMCTRL0 are duplicated in the auto registers. The bits that occur only in DPWMCTRL0
are used for all modes. Bits were selected based on mode switching needs for LLC and PSFB topologies.
The following bitfield descriptions tell whether each field occurs in the auto mode switching registers.
2.15.2 Intra Mux
The Intra Mux bit fields, PWM_A_INTRA_MUX, and PWM_B_INTRA_MUX, enable signals from different
sources to be multiplexed into the 2 DPWM outputs, A and B. This functionality is used in full and half
bridge topologies. The default value for this bit field, 0, causes normal functionality, with the standard
DPWM waveforms as described in the mode descriptions above section to appear on the DPWMA and
DPWMB pins. For details of the Intra Mux, see
.
These fields also occur in the AMS registers.