SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
Different registers in the DPWM block have different time resolutions. Pulse widths are generally adjustable in nominal 250 picosecond steps, while period and phase shift are adjustable in 4 nanosecond steps. The sample trigger is adjustable in 16 nanosecond steps.
Register | Resolution | Number of Bits | Bit Alignment |
---|---|---|---|
Phase Trigger, Period, Event1, Blanking A and B Begin Blanking A and B End Minimum Duty Cycle Low Minimum Duty Cycle High Counter Preset | 4 ns. | 14 | Standard |
Sample Trigger 1 and 2 | 16 ns | 12 | Standard |
Event2,3,4 | 250 ps | 18 | Standard |
Cycle Adjust A and B | 250 ps | 16 (signed) | Standard |
Adaptive Sample | 16 ns | 12 (signed) | 16 ns LSbit |
Resonant Duty | 4 ns. | 16 (signed) or 14 (unsigned) | 4 ns LSbit |
On the UCD3138, all these registers are aligned so that their bit fields match the scaling, except for the Resonant Duty and Adaptive Sample register. All the registers are unsigned, except for the 2 adjust registers, Resonant Duty and Adaptive Sample register, which are signed to permit positive or negative adjustment.
The Resonant Duty register is used in the UCD3138 LLC reference firmware (implemented in UCD3138LLCEVM-028 EVM) as a 14 bit unsigned register. It can also be used as a 16 bit signed register. See Section 2.22.
This means that the Phase Trigger, Period, and Event1 registers ignore the 4 least significant bits, as shown below:
Bit Number | 17:4 | 3:0 |
---|---|---|
Bit Name | PRD | RESERVED |
Access | R/W | - |
Default | 00_0011_0100_0001 | 0000 |
The Sample Trigger registers ignore the 6 least significant bits, as shown here:
Bit Number | 17:6 | 5:0 |
---|---|---|
Bit Name | SAMPLE_TRIGGER | RESERVED |
Access | R/W | - |
Default | 0000_0010_0000 | 00_0000 |
Only the Event 2, 3, and 4 registers use all 18 bits of the field, as shown below.
Bit Number | 17:0 |
---|---|
Bit Name | EVENT2 |
Access | R/W |
Default | 00_0000_0001_0110_0011 |
This means that in all these registers, each bit has the same weight in terms of time. This makes configuration simpler, since all register loads can use the same time base.
To use this feature, use the .all extension on the register structure. The bit fields do not include the ignored bits.
All of these C statements put 10 microseconds into the respective registers. Note that the “Low” resolution clock is at 4 nanoseconds, and “High” resolution is at 250 picoseconds So the corresponding numbers for the registers are 2,500 and 40,000 respectively.
Dpwm0Regs.DPWMPRD.all = 40000; //includes 4 unused least significant bits
Dpwm0Regs.DPWMPRD.bit.PRD = 2500; //only puts in PRD bit field = 40000/16
Dpwm0Regs.DPWMEV1.all = 40000; //includes 4 unused bits
Dpwm0Regs.DPWMEV1.bit.EVENT1 = 2500; //EV1 is the only low resolution event register
Dpwm0Regs.DPWMEV2.all = 40000; //EV2 is high resolution, so
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.