Applications to Power Topologies
767
SPRUHE8E – October 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
C28 Enhanced Pulse Width Modulator (ePWM) Module
Example 7-14. Code Snippet for Configuration in
//===========================================================================
// Config //
// Initialization Time
//===========================================================================
EPwm1Regs.TBPRD = 300;
// Period = 300 TBCLK counts
// (200 KHz @ 60MHz clock)
EPwm1Regs.TBPHS.half.TBPHS = 0;
// Set Phase register to zero
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP;
// Asymmetrical mode
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE;
// Phase loading disabled
EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1;
// Clock ratio to SYSCLKOUT
EPwm1Regs.TBCTL.bit.CLKDIV = TB_DIV1;
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
Pwm1Regs.AQCTLA.bit.ZRO = AQ_SET;
// Set PWM1A on Zero
// Define an event (DCAEVT2) based on
Comparator 1 Output EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL = DC_COMP1OUT;
// DCAH = Comparator
1 output
EPwm1Regs.TZDCSEL.bit.DCAEVT2 = TZ_DCAH_HI;
// DCAEVT2 = DCAH high(will become
active
// as Comparator output goes high)
EPwm1Regs.DCACTL.bit.EVT2SRCSEL = DC_EVT2;
// DCAEVT2 = DCAEVT2 (not filtered)
EPwm1Regs.DCACTL.bit.EVT2FRCSYNCSEL = DC_EVT_ASYNC;
// Take async path // Enable DCAEVT2 as
a one shot trip source
// Note: DCxEVT1 events can be defined
as one-shot.
// DCxEVT2 events can be defined as
cycle-by-
cycle. EPwm1Regs.TZSEL.bit.DCAEVT2 = 1;
// What do we want the DCAEVT1
and DCBEVT1 events to do?
// DCAEVTx events can force EPWMxA //
DCBEVTx events can force EPWMxB
EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO;
// EPWM1A will go low
//===========================================================================
// Run Time
//=========================================================================== //
Adjust reference peak current to Comparator 1 negative input
7.3.11 Controlling H-Bridge LLC Resonant Converter
Various topologies of resonant converters are well-known in the field of power electronics for many years.
In addition to these, H-bridge LLC resonant converter topology has recently gained popularity in many
consumer electronics applications where high efficiency and power density are required. In this example
single channel configuration of ePWM1 is detailed, yet the configuration can easily be extended to multi
channel. Here the controlled parameter is not duty cycle (this is kept constant at approximately 50
percent); instead it is frequency. Although the deadband is not controlled and kept constant as 300ns (i.e
30 @100MHz TBCLK), it is up to user to update it in real time to enhance the efficiency by adjusting
enough time delay for soft switching.