Up-Count, Pulse Placement Asymmetric Waveform With Independent Modulation On Epwmxa - Texas Instruments Concerto F28M35 Series Technical Reference Manual

Table of Contents

Advertisement

www.ti.com
Example 7-2. Code Sample for
// Initialization Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.TBPRD = 600;
EPwm1Regs.CMPA.half.CMPA = 350;
EPwm1Regs.CMPB = 200;
EPwm1Regs.TBPHS = 0;
EPwm1Regs.TBCTR = 0;
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP;
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE;
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE;
EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1;
EPwm1Regs.TBCTL.bit.CLKDIV = TB_DIV1;
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on TBCTR = Zero
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on TBCTR = Zero
EPwm1Regs.AQCTLA.bit.PRD = AQ_CLEAR;
EPwm1Regs.AQCTLA.bit.CAU = AQ_SET;
EPwm1Regs.AQCTLB.bit.PRD = AQ_CLEAR;
EPwm1Regs.AQCTLB.bit.CBU = AQ_SET;
//
// Run Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.CMPA.half.CMPA = Duty1A;
EPwm1Regs.CMPB = Duty1B;
Figure 7-26. Up-Count, Pulse Placement Asymmetric Waveform With Independent Modulation on
TBCTR
TBPRD
value
EPWMxA
Z
T
EPWMxB
A
PWM frequency = 1/( (TBPRD + 1 ) × T
B
Pulse can be placed anywhere within the PWM cycle (0000 - TBPRD)
C
High time duty proportional to (CMPB - CMPA)
D
EPWMxB can be used to generate a 50% duty square wave with frequency = � × ( (TBPRD + 1 ) × TBCLK )
Example 7-3
contains a code sample showing initialization and run time for the waveforms
Use the code in
Example 7-5
SPRUH22I – April 2012 – Revised November 2019
Submit Documentation Feedback
Figure 7-25
// Period = 601 TBCLK counts
// Compare A = 350 TBCLK counts
// Compare B = 200 TBCLK counts
// Set Phase register to zero
// clear TB counter
// Phase loading disabled
// TBCLK = SYSCLKOUT
// adjust duty for output EPWM1A
// adjust duty for output EPWM1B
EPWMxA
CA
CB
)
TBCLK
to define the headers.
Copyright © 2012–2019, Texas Instruments Incorporated
CA
Z
T
C28 Enhanced Pulse Width Modulator (ePWM) Module
ePWM Submodules
CB
Z
T
Figure
7-26.
671

Advertisement

Table of Contents
loading

Table of Contents