Epwm Pdpint-Trip Zone
Epwm Pdpint-Trip Zone
Epwm Pdpint-Trip Zone
Reference Guide
Preface ............................................................................................................................... 9
1 Introduction ............................................................................................................. 13
1.1 Introduction .................................................................................................................. 14
1.2 Submodule Overview ...................................................................................................... 14
1.3 Register Mapping........................................................................................................... 17
4 Registers ................................................................................................................. 93
4.1 Time-Base Submodule Registers ........................................................................................ 94
4.2 Counter-Compare Submodule Registers................................................................................ 97
4.3 Action-Qualifier Submodule Registers ................................................................................. 100
4.4 Dead-Band Submodule Registers ...................................................................................... 104
4.5 PWM-Chopper Submodule Control Register .......................................................................... 106
4.6 Trip-Zone Submodule Control and Status Registers ................................................................. 108
4.7 Digital Compare Submodule Registers ................................................................................ 113
4.8 Event-Trigger Submodule Registers ................................................................................... 113
4.9 Proper Interrupt Initialization Procedure ............................................................................... 118
List of Figures
1-1 Multiple ePWM Modules................................................................................................... 15
1-2 Submodules and Signal Connections for an ePWM Module ......................................................... 16
1-3 ePWM Submodules and Critical Internal Signal Interconnects ...................................................... 17
2-1 Time-Base Submodule Block Diagram .................................................................................. 23
2-2 Time-Base Submodule Signals and Registers ......................................................................... 24
2-3 Time-Base Frequency and Period ....................................................................................... 26
2-4 Time-Base Counter Synchronization Scheme 1 ....................................................................... 27
2-5 Time-Base Counter Synchronization Scheme 2 ....................................................................... 28
2-6 Time-Base Counter Synchronization Scheme 3 ....................................................................... 29
2-7 Time-Base Up-Count Mode Waveforms ................................................................................ 30
2-8 Time-Base Down-Count Mode Waveforms ............................................................................. 31
2-9 Time-Base Up-Down-Count Waveforms, TBCTL[PHSDIR = 0] Count Down On Synchronization Event ...... 31
2-10 Time-Base Up-Down Count Waveforms, TBCTL[PHSDIR = 1] Count Up On Synchronization Event ......... 32
2-11 Counter-Compare Submodule ............................................................................................ 32
2-12 Detailed View of the Counter-Compare Submodule ................................................................... 34
2-13 Counter-Compare Event Waveforms in Up-Count Mode ............................................................. 36
2-14 Counter-Compare Events in Down-Count Mode ....................................................................... 36
2-15 Counter-Compare Events In Up-Down-Count Mode, TBCTL[PHSDIR = 0] Count Down On
Synchronization Event .................................................................................................... 37
2-16 Counter-Compare Events In Up-Down-Count Mode, TBCTL[PHSDIR = 1] Count Up On Synchronization
Event ........................................................................................................................ 37
2-17 Action-Qualifier Submodule ............................................................................................... 38
2-18 Action-Qualifier Submodule Inputs and Outputs ....................................................................... 39
2-19 Possible Action-Qualifier Actions for EPWMxA and EPWMxB Outputs ............................................ 40
2-20 Up-Down-Count Mode Symmetrical Waveform ........................................................................ 43
2-21 Up, Single Edge Asymmetric Waveform, With Independent Modulation on EPWMxA and
EPWMxB—Active High .................................................................................................... 44
2-22 Up, Single Edge Asymmetric Waveform With Independent Modulation on EPWMxA and
EPWMxB—Active Low .................................................................................................... 45
2-23 Up-Count, Pulse Placement Asymmetric Waveform With Independent Modulation on EPWMxA .............. 46
2-24 Up-Down-Count, Dual Edge Symmetric Waveform, With Independent Modulation on EPWMxA and
EPWMxB — Active Low ................................................................................................... 48
2-25 Up-Down-Count, Dual Edge Symmetric Waveform, With Independent Modulation on EPWMxA and
EPWMxB — Complementary ............................................................................................. 49
2-26 Up-Down-Count, Dual Edge Asymmetric Waveform, With Independent Modulation on EPWMxA—Active
Low ........................................................................................................................... 50
2-27 Dead_Band Submodule ................................................................................................... 51
2-28 Configuration Options for the Dead-Band Submodule ................................................................ 52
2-29 Dead-Band Waveforms for Typical Cases (0% < Duty < 100%)..................................................... 54
2-30 PWM-Chopper Submodule ............................................................................................... 56
2-31 PWM-Chopper Submodule Operational Details ........................................................................ 57
2-32 Simple PWM-Chopper Submodule Waveforms Showing Chopping Action Only .................................. 57
2-33 PWM-Chopper Submodule Waveforms Showing the First Pulse and Subsequent Sustaining Pulses ......... 58
2-34 PWM-Chopper Submodule Waveforms Showing the Pulse Width (Duty Cycle) Control of Sustaining
Pulses ........................................................................................................................ 59
2-35 Trip-Zone Submodule ...................................................................................................... 60
2-36 Trip-Zone Submodule Mode Control Logic ............................................................................. 63
2-37 Trip-Zone Submodule Interrupt Logic.................................................................................... 64
2-38 Event-Trigger Submodule ................................................................................................. 64
2-39 Event-Trigger Submodule Inter-Connectivity of ADC Start of Conversion and Interrupt Signals ................ 65
2-40 Event-Trigger Submodule Showing Event Inputs and Prescaled Outputs.......................................... 66
2-41 Event-Trigger Interrupt Generator ........................................................................................ 67
2-42 Event-Trigger SOCA Pulse Generator .................................................................................. 68
List of Tables
1-1 ePWM Module Control and Status Register Set Grouped by Submodule .......................................... 18
2-1 Submodule Configuration Parameters................................................................................... 20
2-2 Time-Base Submodule Registers ........................................................................................ 24
2-3 Key Time-Base Signals .................................................................................................... 25
2-4 Counter-Compare Submodule Registers ............................................................................... 34
2-5 Counter-Compare Submodule Key Signals ............................................................................. 34
2-6 Action-Qualifier Submodule Registers ................................................................................... 38
2-7 Action-Qualifier Submodule Possible Input Events .................................................................... 39
2-8 Action-Qualifier Event Priority for Up-Down-Count Mode ............................................................. 41
2-9 Action-Qualifier Event Priority for Up-Count Mode..................................................................... 41
2-10 Action-Qualifier Event Priority for Down-Count Mode ................................................................. 41
2-11 Behavior if CMPA/CMPB is Greater than the Period .................................................................. 41
2-12 Dead-Band Generator Submodule Registers........................................................................... 51
2-13 Classical Dead-Band Operating Modes ................................................................................ 53
2-14 Dead-Band Delay Values in µS as a Function of DBFED and DBRED ............................................ 55
2-15 PWM-Chopper Submodule Registers ................................................................................... 56
2-16 Possible Pulse Width Values for SYSCLKOUT = 100 MHz .......................................................... 58
2-17 Trip-Zone Submodule Registers ......................................................................................... 61
2-18 Possible Actions On a Trip Event ........................................................................................ 62
2-19 Event-Trigger Submodule Registers .................................................................................... 66
4-1 Time-Base Period Register (TBPRD) Field Descriptions ............................................................. 94
4-2 Time-Base Phase Register (TBPHS) Field Descriptions.............................................................. 94
4-3 Time-Base Counter Register (TBCTR) Field Descriptions............................................................ 94
4-4 Time-Base Control Register (TBCTL) Field Descriptions ............................................................. 95
4-5 Time-Base Status Register (TBSTS) Field Descriptions .............................................................. 97
4-6 Counter-Compare A Register (CMPA) Field Descriptions ............................................................ 98
4-7 Counter-Compare B Register (CMPB) Field Descriptions ............................................................ 98
4-8 Counter-Compare Control Register (CMPCTL) Field Descriptions ................................................. 99
4-9 Compare A High Resolution Register (CMPAHR) Field Descriptions ............................................. 100
4-10 Action-Qualifier Output A Control Register (AQCTLA) Field Descriptions ....................................... 100
4-11 Action-Qualifier Output B Control Register (AQCTLB) Field Descriptions ....................................... 101
4-12 Action-Qualifier Software Force Register (AQSFRC) Field Descriptions .......................................... 103
4-13 Action-qualifier Continuous Software Force Register (AQCSFRC) Field Descriptions .......................... 103
4-14 Dead-Band Generator Control Register (DBCTL) Field Descriptions.............................................. 105
4-15 Dead-Band Generator Rising Edge Delay Register (DBRED) Field Descriptions ............................... 106
4-16 Dead-Band Generator Falling Edge Delay Register (DBFED) Field Descriptions ............................... 106
4-17 PWM-Chopper Control Register (PCCTL) Bit Descriptions ........................................................ 107
4-18 Trip-Zone Submodule Select Register (TZSEL) Field Descriptions ............................................... 108
4-19 Trip-Zone Control Register (TZCTL) Field Descriptions ............................................................. 109
4-20 Trip-Zone Enable Interrupt Register (TZEINT) Field Descriptions ................................................. 110
4-21 Trip-Zone Flag Register (TZFLG) Field Descriptions ................................................................ 110
4-22 Trip-Zone Clear Register (TZCLR) Field Descriptions .............................................................. 111
4-23 Trip-Zone Force Register (TZFRC) Field Descriptions .............................................................. 112
4-24 Event-Trigger Selection Register (ETSEL) Field Descriptions ..................................................... 113
4-25 Event-Trigger Prescale Register (ETPS) Field Descriptions ....................................................... 114
4-26 Event-Trigger Flag Register (ETFLG) Field Descriptions ........................................................... 116
4-27 Event-Trigger Clear Register (ETCLR) Field Descriptions .......................................................... 116
4-28 Event-Trigger Force Register (ETFRC) Field Descriptions ......................................................... 118
A-1 Changes for Revision E .................................................................................................. 119
The Enhanced Pulse Width Modulator (ePWM) module described in this reference guide is a Type 0
ePWM. See the TMS320x28xx, 28xxx DSP Peripheral Reference Guide (SPRU566) for a list of all
devices with a ePWM module of the same type, to determine the differences between the types, and for a
list of device-specific differences within a type. This reference guide includes an overview of the module
and information about each of its sub-modules:
• Time-Base Module
• Counter Compare Module
• Action Qualifier Module
• Dead-Band Generator Module
• PWM Chopper (PC) Module
• Trip Zone Module
• Event Trigger Module
SPRU791— TMS320x280x, 2801x, 2804x Enhanced Pulse Width Modulator (ePWM) Module Reference
Guide describes the main areas of the enhanced pulse width modulator that include digital motor
control, switch mode power supply control, UPS (uninterruptible power supplies), and other forms of
power conversion
SPRU790— TMS320x280x, 2801x, 2804x Enhanced Quadrature Encoder Pulse (eQEP) Reference
Guide describes the eQEP module, which is used for interfacing with a linear or rotary incremental
encoder to get position, direction, and speed information from a rotating machine in high
performance motion and position control systems. It includes the module description and registers
SPRU807— TMS320x280x, 2801x, 2804x Enhanced Capture (eCAP) Module Reference Guide describes
the enhanced capture module. It includes the module description and registers.
SPRU924— TMS320x280x, 2801x, 2804x High-Resolution Pulse Width Modulator (HRPWM) describes
the operation of the high-resolution extension to the pulse width modulator (HRPWM)
SPRU074— TMS320x280x, 2801x, 2804x Enhanced Controller Area Network (eCAN) Reference Guide
describes the eCAN that uses established protocol to communicate serially with other controllers in
electrically noisy environments.
SPRU051— TMS320x280x, 2801x, 2804x Serial Communication Interface (SCI) Reference Guide
describes the SCI, which is a two-wire asynchronous serial port, commonly known as a UART. The
SCI modules support digital communications between the CPU and other asynchronous peripherals
that use the standard non-return-to-zero (NRZ) format.
SPRU059— TMS320x280x, 2801x, 2804x Serial Peripheral Interface (SPI) Reference Guide describes
the SPI - a high-speed synchronous serial input/output (I/O) port - that allows a serial bit stream of
programmed length (one to sixteen bits) to be shifted into and out of the device at a programmed
bit-transfer rate.
SPRU721— TMS320x280x, 2801x, 2804x Inter-Integrated Circuit (I2C) Reference Guide describes the
features and operation of the inter-integrated circuit (I2C) module.
SPRU722— TMS320x280x, 2801x, 2804x Boot ROM Reference Guide describes the purpose and
features of the bootloader (factory-programmed boot-loading software). It also describes other
contents of the device on-chip boot ROM and identifies where all of the information is located within
that memory.
Tools Guides—
SPRU513— TMS320C28x Assembly Language Tools User's Guide describes the assembly language
tools (assembler and other tools used to develop assembly language code), assembler directives,
macros, common object file format, and symbolic debugging directives for the TMS320C28x device.
SPRU514— TMS320C28x Optimizing C Compiler User's Guide describes the TMS320C28x™ C/C++
compiler. This compiler accepts ANSI standard C/C++ source code and produces TMS320 DSP
assembly language source code for the TMS320C28x device.
SPRU608— The TMS320C28x Instruction Set Simulator Technical Overview describes the simulator,
available within the Code Composer Studio for TMS320C2000 IDE, that simulates the instruction
set of the C28x™ core.
SPRU625— TMS320C28x DSP/BIOS Application Programming Interface (API) Reference Guide
describes development using DSP/BIOS.
Application Reports—
SPRAAM0— Getting Started With TMS320C28x™ Digital Signal Controllers is organized by development
flow and functional areas to make your design effort as seamless as possible. Tips on getting
started with C28x™ DSP software and hardware development are provided to aid in your initial
design and debug efforts. Each section includes pointers to valuable information including technical
documentation, software, and tools for use in each phase of design.
Introduction
The enhanced pulse width modulator (ePWM) peripheral is a key element in controlling many of the
power-related systems found in both commercial and industrial equipments. These systems include digital
motor control, switch mode power supply control, uninterruptible power supplies (UPS), and other forms of
power conversion. The ePWM peripheral performs a digital to analog (DAC) function, where the duty cycle
is equivalent to a DAC analog value; it is sometimes referred to as a Power DAC.
This reference guide is applicable for ePWM type 0. See the TMS320x28xx, 28xxx DSP Peripheral
Reference Guide (SPRU566) for a list of all devices with an ePWM module of the same type, to determine
the differences between the types, and for a list of device-specific differences within a type.
1.1 Introduction.............................................................................. 14
1.2 Submodule Overview................................................................. 14
1.3 Register Mapping ...................................................................... 17
1.1 Introduction
An effective PWM peripheral must be able to generate complex pulse width waveforms with minimal CPU
overhead or intervention. It needs to be highly programmable and very flexible while being easy to
understand and use. The ePWM unit described here addresses these requirements by allocating all
needed timing and control resources on a per PWM channel basis. Cross coupling or sharing of resources
has been avoided; instead, the ePWM is built up from smaller single channel modules with separate
resources and that can operate together as required to form a system. This modular approach results in
an orthogonal architecture and provides a more transparent view of the peripheral structure, helping users
to understand its operation quickly.
In this document the letter x within a signal or module name is used to indicate a generic ePWM instance
on a device. For example output signals EPWMxA and EPWMxB refer to the output signals from the
ePWMx instance. Thus, EPWM1A and EPWM1B belong to ePWM1 and likewise EPWM4A and EPWM4B
belong to ePWM4.
SYNCI
EPWM1INT
EPWM1A
EPWM1SOC
ePWM1 module EPWM1B
SYNCO
xSYNCO
To eCAP1
SYNCI
EPWM2INT EPWM2A
SYNCO
SYNCI
EPWMxINT EPWMxA
EPWMxSOC
ePWMx module EPWMxB
TZ1 to TZ6
SYNCO
xSOC
Peripheral
ADC Frame 1
The order in which the ePWM modules are connected may differ from what is shown in Figure 1-1. See
Section 2.2.3.2 for the synchronization scheme for a particular device. Each ePWM module consists of
seven submodules and is connected within a system via the signals shown in Figure 1-2.
ePWM module
EPWMxSYNCI
Time-base (TB) module
EPWMxSYNCO
Counter-compare (CC) module
Figure 1-3 shows more internal details of a single ePWM module. The main signals used by the ePWM
module are:
• PWM output signals (EPWMxA and EPWMxB).
The PWM output signals are made available external to the device through the GPIO peripheral
described in the system control and interrupts guide for your device.
• Trip-zone signals (TZ1 to TZ6).
These input signals alert the ePWM module of an external fault condition. Each module on a device
can be configured to either use or ignore any of the trip-zone signals. The TZ1 to TZ3 trip-zone signals
can be configured as asynchronous inputs through the GPIO peripheral.
• Time-base synchronization input (EPWMxSYNCI) and output (EPWMxSYNCO) signals.
The synchronization signals daisy chain the ePWM modules together. Each module can be configured
to either use or ignore its synchronization input. The clock synchronization input and output signal are
brought out to pins only for ePWM1 (ePWM module #1). The synchronization output for ePWM1
(EPWM1SYNCO) is also connected to the SYNCI of the first enhanced capture module (eCAP1).
• ADC start-of-conversion signals (EPWMxSOCA and EPWMxSOCB).
Each ePWM module has two ADC start of conversion signals (one for each sequencer). Any ePWM
module can trigger a start of conversion for either sequencer. Which event triggers the start of
conversion is configured in the Event-Trigger submodule of the ePWM.
• Peripheral Bus
The peripheral bus is 32-bits wide and allows both 16-bit and 32-bit writes to the ePWM register file.
Time-base (TB)
Sync
TBPRD shadow (16) in/out EPWMxSYNCO
select
TBPRD active (16)
MUX
CTR_PRD S0 S1
16 TBCTL[SWFSYNC] EPWMxSYNCI
Counter
UP/DWN TBCTL[PHSEN]
(16 bit)
CTR = ZERO TBCTL[SWFSYNC] (software
TBCTR
forced sync)
active CTR_Dir
(16)
16
Phase CTR = PRD
TBPHS active (16) EPWMxINT
control CTR = ZERO Event
CTR = CMPA trigger and EPWMxSOCA
CTR = CMPB interrupt
Counter compare (CC) (ET) EPWMxSOCB
CTR_Dir
16
CTR = CMPA
16
Action
qualifier EPWMxA
CMPA active (16) (AQ)
Dead PWM
CMPA shadow (16)
band chopper
16 (DB) (PC) Trip
zone
EPWMxB
CTR = CMPB (TZ)
16
EPWMxTZINT
CMPB active (16)
TZ1 to TZ6
CMPB shadow (16) CTR=ZERO
Figure 1-3 also shows the key internal submodule interconnect signals. Each submodule is described in
detail in its respective section.
Table 1-1. ePWM Module Control and Status Register Set Grouped by Submodule
Offset Size
(1)
Name (x16) Shadow EALLOW Description
Time-Base Submodule Registers
TBCTL 0x0000 1 No Time-Base Control Register
TBSTS 0x0001 1 No Time-Base Status Register
(2)
TBPHSHR 0x0002 1 No Extension for HRPWM Phase Register
TBPHS 0x0003 1 No Time-Base Phase Register
TBCTR 0x0004 1 No Time-Base Counter Register
TBPRD 0x0005 1 Yes Time-Base Period Register
Counter-Compare Submodule Registers
CMPCTL 0x0007 1 No Counter-Compare Control Register
(2)
CMPAHR 0x0008 1 Yes Extension for HRPWM Counter-Compare A Register
CMPA 0x0009 1 Yes Counter-Compare A Register
CMPB 0x000A 1 Yes Counter-Compare B Register
Action-Qualifier Submodule Registers
AQCTLA 0x000B 1 No Action-Qualifier Control Register for Output A (EPWMxA)
AQCTLB 0x000C 1 No Action-Qualifier Control Register for Output B (EPWMxB)
AQSFRC 0x000D 1 No Action-Qualifier Software Force Register
AQCSFRC 0x000E 1 Yes Action-Qualifier Continuous S/W Force Register Set
Dead-Band Generator Submodule Registers
DBCTL 0x000F 1 No Dead-Band Generator Control Register
DBRED 0x0010 1 No Dead-Band Generator Rising Edge Delay Count Register
DBFED 0x0011 1 No Dead-Band Generator Falling Edge Delay Count Register
Trip-Zone Submodule Registers
TZSEL 0x0012 1 Yes Trip-Zone Select Register
(3)
TZCTL 0x0014 1 Yes Trip-Zone Control Register
(3)
TZEINT 0x0015 1 Yes Trip-Zone Enable Interrupt Register
(3)
TZFLG 0x0016 1 Trip-Zone Flag Register
(3)
TZCLR 0x0017 1 Yes Trip-Zone Clear Register
(3)
TZFRC 0x0018 1 Yes Trip-Zone Force Register
Event-Trigger Submodule Registers
ETSEL 0x0019 1 Event-Trigger Selection Register
ETPS 0x001A 1 Event-Trigger Pre-Scale Register
ETFLG 0x001B 1 Event-Trigger Flag Register
ETCLR 0x001C 1 Event-Trigger Clear Register
ETFRC 0x001D 1 Event-Trigger Force Register
PWM-Chopper Submodule Registers
PCCTL 0x001E 1 PWM-Chopper Control Register
High-Resolution Pulse Width Modulator (HRPWM) Extension
Registers
(2) (3)
HRCNFG 0x0020 1 Yes HRPWM Configuration Register
(1)
Locations not shown are reserved.
(2)
These registers are only available on ePWM instances that include the high-resolution PWM extension. Otherwise these
locations are reserved. These registers are described in the TMS320x280x, 2801x, 2804x High-Resolution Pulse Width
Modulator (HRPWM) Reference Guide (SPRU924). See the device specific data manual to determine which instances include
the HRPWM.
(3)
EALLOW protected registers as described in the specific device version of the System Control and Interrupts Reference Guide
listed in Section 1.
ePWM Submodules
Seven submodules are included in every ePWM peripheral. Each of these submodules performs specific
tasks that can be configured by software.
2.1 Overview
Table 2-1 lists the seven key submodules together with a list of their main configuration parameters. For
example, if you need to adjust or control the duty cycle of a PWM waveform, then you should see the
counter-compare submodule in Section 2.3 for relevant details.
Code examples are provided in the remainder of this document that show how to implement various
ePWM module configurations. These examples use the constant definitions shown in Example 2-1. These
definitions are also used in the C280x C/C++ Header Files and Peripheral Examples (SPRC191) and
C2804x C/C++ Header Files and Peripheral Examples (SPRC324).
Example 2-1. Constant Definitions Used in the Code Examples
EPWMxA
EPWMxA
(1)
This register is available only on ePWM instances that include the high-resolution extension (HRPWM). On ePWM modules that
do not include the HRPWM, this location is reserved. This register is described in the device-specific High-Resolution Pulse
Width Modulator (HRPWM) Reference Guide. See the device specific data manual to determine which ePWM instances include
this feature.
The block diagram in Figure 2-2 shows the critical signals and registers of the time-base submodule.
Table 2-3 provides descriptions of the key signals associated with the time-base submodule.
TBPRD
Period Shadow TBCTL[PRDLD]
TBPRD
Period Active
TBCTL[SWFSYNC]
16
TBCTR[15:0] CTR = PRD
EPWMxSYNCI
16
TBCTL[HSPCLKDIV]
TBCTL[CLKDIV]
TPWM TPWM
For Up and Down Count
4 4
TPWM = 2 x TBPRD x TTBCLK
3 3 3 3
FPWM = 1 / (TPWM)
2 2 2 2
1 1 1 1
0 0 0
EPWM1SYNCI
GPIO
ePWM1 MUX
EPWM1SYNCO
SYNCI
eCAP1
EPWM2SYNCI
ePWM2
EPWM2SYNCO
EPWM3SYNCI
ePWM3
EPWM3SYNCO
EPWMxSYNCI
ePWMx
EPWMxSYNCO
Scheme 2 shown in Figure 2-5 is used by the 2804x devices when the ePWM pinout is configured for
A-channel only mode (GPAMCFG[EPWMMODE] = 3). If the 2804x ePWM pinout is configured for 280x
compatible mode (GPAMCFG[EPWMMODE] = 0), then Scheme 1 is used.
EPWM1SYNCI
ePWM1 GPIO
EPWM1SYNCO MUX
SYNCI
eCAP1
EPWM1SYNCI
GPIO
ePWM1 MUX
EPWM1SYNCO
SYNCI
eCAP1
EPWM2SYNCI EPWM2SYNCI
ePWM4 ePWM2
EPWM2SYNCO EPWM2SYNCO
EPWM3SYNCI EPWM3SYNCI
ePWM5 ePWM3
EPWM3SYNCO EPWM3SYNCO
EPWMxSYNCI
ePWM6
EPWMxSYNCO
Each ePWM module can be configured to use or ignore the synchronization input. If the TBCTL[PHSEN]
bit is set, then the time-base counter (TBCTR) of the ePWM module will be automatically loaded with the
phase register (TBPHS) contents when one of the following conditions occur:
• EPWMxSYNCI: Synchronization Input Pulse:
The value of the phase register is loaded into the counter register when an input synchronization pulse
is detected (TBPHS → TBCTR). This operation occurs on the next valid time-base clock (TBCLK)
edge.
• Software Forced Synchronization Pulse:
Writing a 1 to the TBCTL[SWFSYNC] control bit invokes a software forced synchronization. This pulse
is ORed with the synchronization input signal, and therefore has the same effect as a pulse on
EPWMxSYNCI.
• This feature enables the ePWM module to be automatically synchronized to the time base of another
ePWM module. Lead or lag phase control can be added to the waveforms generated by different
ePWM modules to synchronize them. In up-down-count mode, the TBCTL[PSHDIR] bit configures the
direction of the time-base counter immediately after a synchronization event. The new direction is
independent of the direction prior to the synchronization event. The TBPHS bit is ignored in count-up
or count-down modes. See Figure 2-7 through Figure 2-10 for examples.
Clearing the TBCTL[PHSEN] bit configures the ePWM to ignore the synchronization input pulse. The
synchronization pulse can still be allowed to flow-through to the EPWMxSYNCO and be used to
synchronize other ePWM modules. In this way, you can set up a master time-base (for example, ePWM1)
and downstream modules (ePWM2 - ePWMx) may elect to run in synchronization with the master. See
the Application to Power Topologies Chapter 3 for more details on synchronization strategies.
TBPRD
(value)
TBPHS
(value)
0000
EPWMxSYNCI
CTR_dir
CTR = zero
CTR = PRD
CNT_max
TBPRD
(value)
TBPHS
(value)
0x000
EPWMxSYNCI
CTR_dir
CTR = zero
CTR = PRD
CNT_max
0xFFFF
TBPRD
(value)
TBPHS
(value)
0x0000
EPWMxSYNCI
UP UP UP UP
CTR_dir
DOWN DOWN DOWN
CTR = zero
CTR = PRD
CNT_max
TBPRD (value)
TBPHS (value)
0x0000
EPWMxSYNCI
UP UP UP
CTR_dir
DOWN DOWN DOWN
CTR = zero
CTR = PRD
CNT_max
EPWMxA
EPWMxA
(1)
This register is available only on ePWM modules with the high-resolution extension (HRPWM). On ePWM modules that do not
include the HRPWM this location is reserved. This register is described in the device-specific High-Resolution Pulse Width
Modulator (HRPWM) Reference Guide. Refer to the device specific data manual to determine which ePWM instances include
this feature.
Time TBCTR[15:0] 16
Base
(TB)
Module CTR = CMPA
CMPA[15:0] 16
Digital
comparator A
CMPCTL
Shadow [SHDWAFULL]
CTR = PRD CMPA Action
load Compare A Active Reg. CMPCTL Qualifier
CTR =0 (AQ)
CMPA [SHDWAMODE]
Compare A Shadow Reg. Module
CMPCTL[LOADAMODE] 16
TBCTR[15:0]
CTR = CMPB
CMPB[15:0] 16 Digital
comparator B
CMPCTL[LOADBMODE]
The key signals associated with the counter-compare submodule are described in Table 2-5.
The counter-compare registers CMPA and CMPB each have an associated shadow register. Shadowing
provides a way to keep updates to the registers synchronized with the hardware. When shadowing is
used, updates to the active registers only occurs at strategic points. This prevents corruption or spurious
operation due to the register being asynchronously modified by software. The memory address of the
active register and the shadow register is identical. Which register is written to or read from is determined
by the CMPCTL[SHDWAMODE] and CMPCTL[SHDWBMODE] bits. These bits enable and disable the
CMPA shadow register and CMPB shadow register respectively. The behavior of the two load modes is
described below:
• Shadow Mode:
The shadow mode for the CMPA is enabled by clearing the CMPCTL[SHDWAMODE] bit and the
shadow register for CMPB is enabled by clearing the CMPCTL[SHDWBMODE] bit. Shadow mode is
enabled by default for both CMPA and CMPB.
If the shadow register is enabled then the content of the shadow register is transferred to the active
register on one of the following events:
– CTR = PRD: Time-base counter equal to the period (TBCTR = TBPRD).
– CTR = Zero: Time-base counter equal to zero (TBCTR = 0x0000)
– Both CTR = PRD and CTR = Zero
Which of these three events is specified by the CMPCTL[LOADAMODE] and CMPCTL[LOADBMODE]
register bits. Only the active register contents are used by the counter-compare submodule to generate
events to be sent to the action-qualifier.
• Immediate Load Mode:
If immediate load mode is selected (i.e., TBCTL[SHADWAMODE] = 1 or TBCTL[SHADWBMODE] = 1),
then a read from or a write to the register will go directly to the active register.
0xFFFF
TBPRD
(value)
CMPA
(value)
CMPB
(value)
TBPHS
(value)
0x0000
EPWMxSYNCI
CTR = CMPA
CTR = CMPB
NOTE: An EPWMxSYNCI external synchronization event can cause a discontinuity in the TBCTR count
sequence. This can lead to a compare event being skipped. This skipping is considered normal operation
and must be taken into account.
0xFFFF
TBPRD
(value)
CMPA
(value)
CMPB
(value)
TBPHS
(value)
0x0000
EPWMxSYNCI
CTR = CMPA
CTR = CMPB
0xFFFF
TBPRD (value)
CMPA (value)
CMPB (value)
TBPHS (value)
0x0000
EPWMxSYNCI
CTR = CMPB
CTR = CMPA
EPWMxSYNCI
CTR = CMPB
CTR = CMPA
EPWMxA
EPWMxA
The action-qualifier submodule has the most important role in waveform construction and PWM
generation. It decides which events are converted into various action types, thereby producing the
required switched waveforms at the EPWMxA and EPWMxB outputs.
AQCSFRC[3:0] (active)
continuous S/W force
For convenience, the possible input events are summarized again in Table 2-7.
The software forced action is a useful asynchronous event. This control is handled by registers AQSFRC
and AQCSFRC.
The action-qualifier submodule controls how the two outputs EPWMxA and EPWMxB behave when a
particular event occurs. The event inputs to the action-qualifier submodule are further qualified by the
counter direction (up or down). This allows for independent action on outputs on both the count-up and
count-down phases.
The possible actions imposed on outputs EPWMxA and EPWMxB are:
• Set High:
Set output EPWMxA or EPWMxB to a high level.
• Clear Low:
Set output EPWMxA or EPWMxB to a low level.
• Toggle:
If EPWMxA or EPWMxB is currently pulled high, then pull the output low. If EPWMxA or EPWMxB is
currently pulled low, then pull the output high.
• Do Nothing:
Keep outputs EPWMxA and EPWMxB at same level as currently set. Although the "Do Nothing" option
prevents an event from causing an action on the EPWMxA and EPWMxB outputs, this event can still
trigger interrupts and ADC start of conversion. See the Event-trigger Submodule description in
Section 2.8 for details.
Actions are specified independently for either output (EPWMxA or EPWMxB). Any or all events can be
configured to generate actions on a given output. For example, both CTR = CMPA and CTR = CMPB can
operate on output EPWMxA. All qualifier actions are configured via the control registers found at the end
of this section.
For clarity, the drawings in this document use a set of symbolic actions. These symbols are summarized in
Figure 2-19. Each symbol represents an action as a marker in time. Some actions are fixed in time (zero
and period) while the CMPA and CMPB actions are moveable and their time positions are programmed
via the counter-compare A and B registers, respectively. To turn off or disable an action, use the "Do
Nothing option"; it is the default at reset.
Figure 2-19. Possible Action-Qualifier Actions for EPWMxA and EPWMxB Outputs
TB Counter equals:
S/W Actions
force
Zero Comp Comp Period
A B
SW Z CA CB P
Do Nothing
SW Z CA CB P
Clear Low
SW Z CA CB P
Set High
SW Z CA CB P
T T T T T Toggle
Table 2-9 shows the action-qualifier priority for up-count mode. In this case, the counter direction is always
defined as up and thus down-count events will never be taken.
Table 2-10 shows the action-qualifier priority for down-count mode. In this case, the counter direction is
always defined as down and thus up-count events will never be taken.
It is possible to set the compare value greater than the period. In this case the action will take place as
shown in Table 2-11.
Note: The waveforms in this document show the ePWMs behavior for a static compare register
value. In a running system, the active compare registers (CMPA and CMPB) are typically
updated from their respective shadow registers once every period. The user specifies when
the update will take place; either when the time-base counter reaches zero or when the
time-base counter reaches period. There are some cases when the action based on the new
value can be delayed by one period or the action based on the old value can take effect for
an extra period. Some PWM configurations avoid this situation. These include, but are not
limited to, the following:
Use up-down-count mode to generate a symmetric PWM:
• If you load CMPA/CMPB on zero, then use CMPA/CMPB values greater
than or equal to 1.
• If you load CMPA/CMPB on period, then use CMPA/CMPB values less than
or equal to TBPRD-1.
This means there will always be a pulse of at least one TBCLK cycle in a
PWM period which, when very short, tend to be ignored by the system.
Use up-down-count mode to generate an asymmetric PWM:
• To achieve 50%-0% asymmetric PWM use the following configuration: Load
CMPA/CMPB on period and use the period action to clear the PWM and a
compare-up action to set the PWM. Modulate the compare value from 0 to
TBPRD to achieve 50%-0% PWM duty.
When using up-count mode to generate an asymmetric PWM:
• To achieve 0-100% asymmetric PWM use the following configuration: Load
CMPA/CMPB on TBPRD. Use the Zero action to set the PWM and a
compare-up action to clear the PWM. Modulate the compare value from 0 to
TBPRD+1 to achieve 0-100% PWM duty.
See the Using Enhanced Pulse Width Modulator (ePWM) Module for 0-100%
Duty Cycle Control Application Report (literature number SPRAAI1)
Figure 2-20 shows how a symmetric PWM waveform can be generated using the up-down-count mode of
the TBCTR. In this mode 0%-100% DC modulation is achieved by using equal compare matches on the
up count and down count portions of the waveform. In the example shown, CMPA is used to make the
comparison. When the counter is incrementing the CMPA match will pull the PWM output high. Likewise,
when the counter is decrementing the compare match will pull the PWM signal low. When CMPA = 0, the
PWM signal is low for the entire period giving the 0% duty waveform. When CMPA = TBPRD, the PWM
signal is high achieving 100% duty.
TBCTR Direction
UP DOWN UP DOWN
Case 1: EPWMxA/EPWMxB
CMPA = 4, 0% Duty
Case 2: EPWMxA/EPWMxB
CMPA = 3, 25% Duty
Case 3:
EPWMxA/EPWMxB
CMPA = 2, 50% Duty
Case 3:
EPWMxA/EPWMxB
CMPA = 1, 75% Duty
Case 4: EPWMxA/EPWMxB
CMPA = 0, 100% Duty
The PWM waveforms in Figure 2-21 through Figure 2-26 show some common action-qualifier
configurations. The C-code samples in Example 2-2 through Example 2-7 shows how to configure an
ePWM module for each case. Some conventions used in the figures and examples are as follows:
• TBPRD, CMPA, and CMPB refer to the value written in their respective registers. The active register,
not the shadow register, is used by the hardware.
• CMPx, refers to either CMPA or CMPB.
• EPWMxA and EPWMxB refer to the output signals from ePWMx
• Up-Down means Count-up-and-down mode, Up means up-count mode and Dwn means down-count
mode
• Sym = Symmetric, Asym = Asymmetric
Figure 2-21. Up, Single Edge Asymmetric Waveform, With Independent Modulation on EPWMxA and
EPWMxB—Active High
TBCTR
TBPRD
value
Z P CB CA Z P CB CA Z P
EPWMxA
Z P CB CA Z P CB CA Z P
EPWMxB
Example 2-2 contains a code sample showing initialization and run time for the waveforms in Figure 2-21.
// Initialization Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.TBPRD = 600; // Period = 601 TBCLK counts
EPwm1Regs.CMPA.half.CMPA = 350; // Compare A = 350 TBCLK counts
EPwm1Regs.CMPB = 200; // Compare B = 200 TBCLK counts
EPwm1Regs.TBPHS = 0; // Set Phase register to zero
EPwm1Regs.TBCTR = 0; // clear TB counter
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP;
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Phase loading disabled
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE;
EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // TBCLK = SYSCLK
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 CTR = Zero
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR = Zero
EPwm1Regs.AQCTLA.bit.ZRO = AQ_SET;
EPwm1Regs.AQCTLA.bit.CAU = AQ_CLEAR;
EPwm1Regs.AQCTLB.bit.ZRO = AQ_SET;
EPwm1Regs.AQCTLB.bit.CBU = AQ_CLEAR;
//
// Run Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.CMPA.half.CMPA = Duty1A; // adjust duty for output EPWM1A
EPwm1Regs.CMPB = Duty1B; // adjust duty for output EPWM1B
Figure 2-22. Up, Single Edge Asymmetric Waveform With Independent Modulation on EPWMxA and
EPWMxB—Active Low
TBCTR
TBPRD
value
P CA P CA P
EPWMxA
P CB P CB P
EPWMxB
Example 2-3 contains a code sample showing initialization and run time for the waveforms in Figure 2-22.
// Initialization Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.TBPRD = 600; // Period = 601 TBCLK counts
EPwm1Regs.CMPA.half.CMPA = 350; // Compare A = 350 TBCLK counts
EPwm1Regs.CMPB = 200; // Compare B = 200 TBCLK counts
EPwm1Regs.TBPHS = 0; // Set Phase register to zero
EPwm1Regs.TBCTR = 0; // clear TB counter
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP;
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Phase loading disabled
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE;
EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // TBCLK = SYSCLKOUT
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; // adjust duty for output EPWM1A
EPwm1Regs.CMPB = Duty1B; // adjust duty for output EPWM1B
Figure 2-23. Up-Count, Pulse Placement Asymmetric Waveform With Independent Modulation on
EPWMxA
TBCTR
TBPRD
value
EPWMxA
Z Z Z
T T T
EPWMxB
Example 2-4 contains a code sample showing initialization and run time for the waveforms Figure 2-23.
Use the code in Example 2-1 to define the headers.
// Initialization Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.TBPRD = 600; // Period = 601 TBCLK counts
EPwm1Regs.CMPA.half.CMPA = 200; // Compare A = 200 TBCLK counts
EPwm1Regs.CMPB = 400; // Compare B = 400 TBCLK counts
EPwm1Regs.TBPHS = 0; // Set Phase register to zero
EPwm1Regs.TBCTR = 0; // clear TB counter
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP;
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Phase loading disabled
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE;
EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // TBCLK = SYSCLKOUT
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.CAU = AQ_SET;
EPwm1Regs.AQCTLA.bit.CBU = AQ_CLEAR;
EPwm1Regs.AQCTLB.bit.ZRO = AQ_TOGGLE;
//
// Run Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.CMPA.half.CMPA = EdgePosA; // adjust duty for output EPWM1A only
EPwm1Regs.CMPB = EdgePosB;
Figure 2-24. Up-Down-Count, Dual Edge Symmetric Waveform, With Independent Modulation on
EPWMxA and EPWMxB — Active Low
TBCTR
TBPRD
value
CA CA CA CA
EPWMxA
CB CB CB CB
EPWMxB
Example 2-5 contains a code sample showing initialization and run time for the waveforms in Figure 2-24.
Use the code in Example 2-1 to define the headers.
Example 2-5. Code Sample for Figure 2-24
// Initialization Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.TBPRD = 600; // Period = 2×600 TBCLK counts
EPwm1Regs.CMPA.half.CMPA = 400; // Compare A = 400 TBCLK counts
EPwm1Regs.CMPB = 500; // Compare B = 500 TBCLK counts
EPwm1Regs.TBPHS = 0; // Set Phase register to zero
EPwm1Regs.TBCTR = 0; // clear TB counter
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetric
xEPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Phase loading disabled
xEPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE;
EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // TBCLK = SYSCLKOUT
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 CTR = Zero
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR = Zero
EPwm1Regs.AQCTLA.bit.CAU = AQ_SET;
EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm1Regs.AQCTLB.bit.CBU = AQ_SET;
EPwm1Regs.AQCTLB.bit.CBD = AQ_CLEAR;
//
// Run Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.CMPA.half.CMPA = Duty1A; // adjust duty for output EPWM1A
EPwm1Regs.CMPB = Duty1B; // adjust duty for output EPWM1B
Figure 2-25. Up-Down-Count, Dual Edge Symmetric Waveform, With Independent Modulation on
EPWMxA and EPWMxB — Complementary
TBCTR
TBPRD
value
CA CA CA CA
EPWMxA
CB CB CB CB
EPWMxB
Example 2-6 contains a code sample showing initialization and run time for the waveforms in Figure 2-25.
Use the code in Example 2-1 to define the headers.
Example 2-6. Code Sample for Figure 2-25
// Initialization Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.TBPRD = 600; // Period = 2×600 TBCLK counts
EPwm1Regs.CMPA.half.CMPA = 350; // Compare A = 350 TBCLK counts
EPwm1Regs.CMPB = 400; // Compare B = 400 TBCLK counts
EPwm1Regs.TBPHS = 0; // Set Phase register to zero
EPwm1Regs.TBCTR = 0; // clear TB counter
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetric
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Phase loading disabled
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE;
EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // TBCLK = SYSCLKOUT
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 CTR = Zero
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR = Zero
EPwm1Regs.AQCTLA.bit.CAU = AQ_SET;
EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm1Regs.AQCTLB.bit.CBU = AQ_CLEAR;
EPwm1Regs.AQCTLB.bit.CBD = AQ_SET;
// Run Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.CMPA.half.CMPA = Duty1A; // adjust duty for output EPWM1A
EPwm1Regs.CMPB = Duty1B; // adjust duty for output EPWM1B
Figure 2-26. Up-Down-Count, Dual Edge Asymmetric Waveform, With Independent Modulation on
EPWMxA—Active Low
TBCTR
CA CB CA CB
EPWMxA
Z P Z P
EPWMxB
Example 2-7 contains a code sample showing initialization and run time for the waveforms in Figure 2-26.
Use the code in Example 2-1 to define the headers.
Example 2-7. Code Sample for Figure 2-26
// Initialization Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.TBPRD = 600; // Period = 2 × 600 TBCLK counts
EPwm1Regs.CMPA.half.CMPA = 250; // Compare A = 250 TBCLK counts
EPwm1Regs.CMPB = 450; // Compare B = 450 TBCLK counts
EPwm1Regs.TBPHS = 0; // Set Phase register to zero
EPwm1Regs.TBCTR = 0; // clear TB counter
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN;// Symmetric
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Phase loading disabled
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE;
EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // TBCLK = SYSCLKOUT
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 CTR = Zero
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR = Zero
EPwm1Regs.AQCTLA.bit.CAU = AQ_SET;
EPwm1Regs.AQCTLA.bit.CBD = AQ_CLEAR;
EPwm1Regs.AQCTLB.bit.ZRO = AQ_CLEAR;
EPwm1Regs.AQCTLB.bit.PRD = AQ_SET;
// Run Time
// = = = = = = = = = = = = = = = = = = = = = = = =
EPwm1Regs.CMPA.half.CMPA = EdgePosA; // adjust duty for output EPWM1A only
EPwm1Regs.CMPB = EdgePosB;
EPWMxA
EPWMxA
Rising edge 0 S1
0 S2 EPWMxA
0 S4 delay RED
EPWMxA in
In Out 1
1
1 (10-bit
counter)
Falling edge 0 S3
0 S5 delay FED 1 S0
EPWMxB
In Out
1
1 (10-bit 0
counter)
Figure 2-29 shows waveforms for typical cases where 0% < duty < 100%.
Figure 2-29. Dead-Band Waveforms for Typical Cases (0% < Duty < 100%)
Period
Original
(outA)
RED
Rising Edge
Delayed (RED)
FED
Falling Edge
Delayed (FED)
Active High
Complementary
(AHC)
Active Low
Complementary
(ALC)
Active High
(AH)
Active Low
(AL)
EPWMxA
EPWMxB
The PWM-chopper submodule allows a high-frequency carrier signal to modulate the PWM waveform
generated by the action-qualifier and dead-band submodules. This capability is important if you need
pulse transformer-based gate drivers to control the power switching elements.
SYSCLKOUT /8
PCCTL
[OSHTWTH]
Divider and PCCTL
PSCLK [CHPEN]
duty control
PCCTL
[OSHTWTH]
PCCTL[CHPFREQ]
PCCTL[CHPDUTY]
Pulse-width
Clk
One PWMB_ch
EPWMxB shot
OSHT 1
Start EPWMxA
Bypass 0
2.6.4 Waveforms
Figure 2-32 shows simplified waveforms of the chopping action only; one-shot and duty-cycle control are
not shown. Details of the one-shot and duty-cycle control are discussed in the following sections.
Figure 2-32. Simple PWM-Chopper Submodule Waveforms Showing Chopping Action Only
EPWMxA
EPWMxB
PSCLK
EPWMxA
EPWMxB
Figure 2-33. PWM-Chopper Submodule Waveforms Showing the First Pulse and Subsequent Sustaining
Pulses
Start OSHT pulse
EPWMxA in
PSCLK
EPWMxA out
Sustaining pulses
Figure 2-34. PWM-Chopper Submodule Waveforms Showing the Pulse Width (Duty Cycle) Control of
Sustaining Pulses
PSCLK
PSCLK
period
PSCLK Period
75% 50% 25%
87.5% 62.5% 37.5% 12.5%
Duty
1/8
Duty
2/8
Duty
3/8
Duty
4/8
Duty
5/8
Duty
6/8
Duty
7/8
EPWMxA
EPWMxA
Each ePWM module is connected to six TZn signals (TZ1 to TZ6) that are sourced from the GPIO MUX.
These signals indicate external fault or trip conditions, and the ePWM outputs can be programmed to
respond accordingly when faults occur.
(1)
All trip-zone registers are EALLOW protected and can be modified only after executing the EALLOW instruction. For more
information, see the device-specific version of the System Control and Interrupts Reference Guide listed in Section 1.
Scenario A:
A one-shot trip event on TZ1 pulls both EPWM1A, EPWM1B low and also forces EPWM2A and
EPWM2B high.
• Configure the ePWM1 registers as follows:
– TZSEL[OSHT1] = 1: enables TZ1 as a one-shot event source for ePWM1
– TZCTL[TZA] = 2: EPWM1A will be forced low on a trip event.
– TZCTL[TZB] = 2: EPWM1B will be forced low on a trip event.
• Configure the ePWM2 registers as follows:
– TZSEL[OSHT1] = 1: enables TZ1 as a one-shot event source for ePWM2
– TZCTL[TZA] = 1: EPWM2A will be forced high on a trip event.
– TZCTL[TZB] = 1: EPWM2B will be forced high on a trip event.
Scenario B:
A cycle-by-cycle event on TZ5 pulls both EPWM1A, EPWM1B low.
A one-shot event on TZ1 or TZ6 puts EPWM2A into a high impedance state.
• Configure the ePWM1 registers as follows:
– TZSEL[CBC5] = 1: enables TZ5 as a one-shot event source for ePWM1
– TZCTL[TZA] = 2: EPWM1A will be forced low on a trip event.
– TZCTL[TZB] = 2: EPWM1B will be forced low on a trip event.
• Configure the ePWM2 registers as follows:
– TZSEL[OSHT1] = 1: enables TZ1 as a one-shot event source for ePWM2
– TZSEL[OSHT6] = 1: enables TZ6 as a one-shot event source for ePWM1
– TZCTL[TZA] = 0: EPWM1A will be put into a high-impedance state on a trip event.
– TZCTL[TZB] = 3: EPWM1B will ignore the trip event.
CTR=zero Clear
Latch
cyc−by-cyc Trip
mode CBC
(CBC) trip event
TZFRC[CBC]
Set
TZ1
TZ2 Set
TZ3
Sync
TZ4
TZFLG[CBC]
TZ5
TZ6
TZCLR[CBC] Clear
TZSEL[CBC1 to CBC6]
TZCLR[OST] Clear
Latch
one-shot Trip
mode OSHT
(OSHT) trip event
TZFRC[OSHT]
Set
TZ1
TZ2
TZ3
Sync
TZ4
TZ5 Async Trip
TZ6
TZFLG[OST]
Generate
EPWMx_TZINT interrupt Clear TZCLR[OST]
(PIE) pulse when
input=1 Latch
OSHT
Set
TZEINT[OST] trip event
EPWMxA
EPWMA
Figure 2-39. Event-Trigger Submodule Inter-Connectivity of ADC Start of Conversion and Interrupt
Signals
EPWM1INT
EPWM1 EPWM1SOCA
module EPWM1SOCB
EPWM2INT
EPWM2 EPWM2SOCA PIE
module EPWM2SOCB
EPWMxINT
EPWMx EPWMxSOCA
module EPWMxSOCB
SOCB SOCA
ADC
The event-trigger submodule monitors various event conditions (the left side inputs to event-trigger
submodule shown in Figure 2-40) and can be configured to prescale these events before issuing an
Interrupt request or an ADC start of conversion. The event-trigger prescaling logic can issue Interrupt
requests and ADC start of conversion at:
• Every event
• Every second event
• Every third event
Figure 2-40. Event-Trigger Submodule Showing Event Inputs and Prescaled Outputs
clear
CTR=Zero EPWMxINTn
Event Trigger /n PIE
Module Logic
CTR=PRD
count
clear
CTRU=CMPA
ETSEL reg
CTR=CMPA CTRD=CMPA EPWMxSOCA
/n
Direction
CTRU=CMPB ETPS reg
qualifier
count
CTR=CMPB CTRD=CMPB
ETFLG reg ADC
clear
The key registers used to configure the event-trigger submodule are shown in Table 2-19:
• ETSEL—This selects which of the possible events will trigger an interrupt or start an ADC conversion
• ETPS—This programs the event prescaling options mentioned above.
• ETFLG—These are flag bits indicating status of the selected and prescaled events.
• ETCLR—These bits allow you to clear the flag bits in the ETFLG register via software.
• ETFRC—These bits allow software forcing of an event. Useful for debugging or s/w intervention.
A more detailed look at how the various register bits interact with the Interrupt and ADC start of
conversion logic are shown in Figure 2-41, Figure 2-42, and Figure 2-43.
Figure 2-41 shows the event-trigger's interrupt generation logic. The interrupt-period (ETPS[INTPRD]) bits
specify the number of events required to cause an interrupt pulse to be generated. The choices available
are:
• Do not generate an interrupt.
• Generate an interrupt on every event
• Generate an interrupt on every second event
• Generate an interrupt on every very third event
Which event can cause an interrupt is configured by the interrupt selection (ETSEL[INTSEL]) bits. The
event can be one of the following:
• Time-base counter equal to zero (TBCTR = 0x0000).
• Time-base counter equal to period (TBCTR = TBPRD).
• Time-base counter equal to the compare A register (CMPA) when the timer is incrementing.
• Time-base counter equal to the compare A register (CMPA) when the timer is decrementing.
• Time-base counter equal to the compare B register (CMPB) when the timer is incrementing.
• Time-base counter equal to the compare B register (CMPB) when the timer is decrementing.
ETCLR[INT] Clear
Latch ETFLG[INT]
Set
ETPS[INTCNT]
Generate ETSEL[INTSEL]
1 0
interrupt Clear CNT
EPWMxINT pulse
2-bit
when ETFRC[INT]
0 Counter
input = 1 000 0
001 CTR=Zero
010 CTR=PRD
Inc CNT 011 0
100 CTRU=CMPA
ETSEL[INT] 101 CTRD=CMPA
101 CTRU=CMPB
111 CTRD=CMPB
ETPS[INTPRD]
Figure 2-42 shows the operation of the event-trigger's start-of-conversion-A (SOCA) pulse generator. The
ETPS[SOCACNT] counter and ETPS[SOCAPRD] period values behave similarly to the interrupt generator
except that the pulses are continuously generated. That is, the pulse flag ETFLG[SOCA] is latched when a
pulse is generated, but it does not stop further pulse generation. The enable/disable bit ETSEL[SOCAEN]
stops pulse generation, but input events can still be counted until the period value is reached as with the
interrupt generation logic. The event that will trigger an SOCA and SOCB pulse can be configured
separately in the ETSEL[SOCASEL] and ETSEL[SOCBSEL] bits. The possible events are the same
events that can be specified for the interrupt generation logic.
ETPS[SOCACNT]
ETSEL[SOCASEL]
Clear CNT
Generate
ETFRC[SOCA]
SOC 2-bit
SOCA pulse Counter 0
000
when 001 CTR=Zero
input = 1 010 CTR=PRD
Inc CNT
011 0
100 CTRU=CMPA
ETSEL[SOCAEN] 101 CTRD=CMPA
ETPS[SOCAPRD] 101 CTRU=CMPB
111 CTRD=CMPB
Figure 2-43 shows the operation of the event-trigger's start-of-conversion-B (SOCB) pulse generator. The
event-trigger's SOCB pulse generator operates the same way as the SOCA.
ETPS[SOCBCNT]
ETSEL[SOCBSEL]
Clear CNT
Generate ETFRC[SOCB]
SOC 2-bit
SOCB pulse Counter 000 0
when 001 CTR=Zero
input = 1 010 CTR=PRD
Inc CNT
011 0
100 CTRU=CMPA
ETSEL[SOCBEN] 101 CTRD=CMPA
ETPS[SOCBPRD] 101 CTRU=CMPB
111 CTRD=CMPB
An ePWM module has all the local resources necessary to operate completely as a standalone module or
to operate in synchronization with other identical ePWM modules.
SyncIn
Phase reg EN
Φ=0° EPWMxA
EPWMxB
CTR = 0
CTR=CMPB
X
SyncOut
EPWM1B EPWM2B
CTR=0 CTR=0
CTR=CMPB CTR=CMPB
X X
1 SyncOut 2 SyncOut
Figure 3-3. Control of Four Buck Stages. Here FPWM1≠ FPWM2≠ FPWM3≠ FPWM4
Ext SyncIn
Master1 (optional)
Phase reg SyncIn
En Vin1 Vout1
Φ=X EPWM1A
EPWM1B Buck #1
CTR=zero
CTR=CMPB EPWM1A
X
1 SyncOut
Master2
Phase reg SyncIn Vin2 Vout2
En
Φ=X EPWM2A
Buck #2
EPWM2B
CTR=zero EPWM2A
CTR=CMPB
X
2 SyncOut
Master3
Phase reg SyncIn
En Vin3 Vout3
Φ=X EPWM3A
EPWM3B Buck #3
CTR=zero
CTR=CMPB EPWM3A
X
3 SyncOut
Master4
Phase reg SyncIn Vin4 Vout4
En
Φ=X EPWM4A
Buck #4
EPWM4B
CTR=zero EPWM4A
CTR=CMPB
X
3 SyncOut
Figure 3-4. Buck Waveforms for Figure 3-3 (Note: Only three bucks shown here)
P P P
I I I
700 950
1200
P CA CB P CA P
A
EPWM1A
Pulse center
700 1150
1400
P CA CB P CA
A
EPWM2A
650
500
800
CA
CA P P CA P
CB
A
EPWM3A
P Indicates this event triggers an interrupt CB Indicates this event triggers an ADC start
I A of conversion
//=====================================================================
// (Note: code for only 3 modules shown)
// Initialization Time
//========================
// EPWM Module 1 config
EPwm1Regs.TBPRD = 1200; // Period = 1201 TBCLK counts
EPwm1Regs.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.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE;
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm1Regs.AQCTLA.bit.PRD = AQ_CLEAR;
EPwm1Regs.AQCTLA.bit.CAU = AQ_SET;
// EPWM Module 2 config
EPwm2Regs.TBPRD = 1400; // Period = 1401 TBCLK counts
EPwm2Regs.TBPHS = 0; // Set Phase register to zero
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP; // Asymmetrical mode
EPwm2Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Phase loading disabled
EPwm2Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm2Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE;
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm2Regs.AQCTLA.bit.PRD = AQ_CLEAR;
EPwm2Regs.AQCTLA.bit.CAU = AQ_SET;
// EPWM Module 3 config
EPwm3Regs.TBPRD = 800; // Period = 801 TBCLK counts
EPwm3Regs.TBPHS = 0; // Set Phase register to zero
EPwm3Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP;
EPwm3Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Phase loading disabled
EPwm3Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm3Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_DISABLE;
EPwm3Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm3Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm3Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm3Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm3Regs.AQCTLA.bit.PRD = AQ_CLEAR;
EPwm3Regs.AQCTLA.bit.CAU = AQ_SET;
//
// Run Time (Note: Example execution of one run-time instant)
//=========================================================
EPwm1Regs.CMPA.half.CMPA = 700; // adjust duty for output EPWM1A
EPwm2Regs.CMPA.half.CMPA = 700; // adjust duty for output EPWM2A
EPwm3Regs.CMPA.half.CMPA = 500; // adjust duty for output EPWM3A
EPWM1B
CTR=zero Buck #2
CTR=CMPB EPWM1B
X
SyncOut
Vin3 Vout3
Slave Buck #3
Phase reg SyncIn EPWM2A
En
Φ=X EPWM2A
EPWM2B Vin4 Vout4
CTR=zero
CTR=CMPB
X Buck #4
SyncOut EPWM2B
Figure 3-6. Buck Waveforms for Figure 3-5 (Note: FPWM2 = FPWM1))
Z 600 Z Z
I 400 400 I I
200 200
CA P CA CA P CA
A A
EPWM1A
CB CB CB CB
EPWM1B
500 500
300 300
CA CA CA CA
EPWM2A
CB CB CB CB
EPWM2B
//=====================================================================
// Config
//=====================================================================
// Initialization Time
//========================
// EPWM Module 1 config
EPwm1Regs.TBPRD = 600; // Period = 1200 TBCLK counts
EPwm1Regs.TBPHS = 0; // Set Phase register to zero
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetrical mode
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Master module
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; // Sync down-stream module
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm1Regs.AQCTLA.bit.CAU = AQ_SET; // set actions for EPWM1A
EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm1Regs.AQCTLB.bit.CBU = AQ_SET; // set actions for EPWM1B
EPwm1Regs.AQCTLB.bit.CBD = AQ_CLEAR;
// EPWM Module 2 config
EPwm2Regs.TBPRD = 600; // Period = 1200 TBCLK counts
EPwm2Regs.TBPHS = 0; // Set Phase register to zero
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetrical mode
EPwm2Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Slave module
EPwm2Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm2Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; // sync flow-through
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm2Regs.AQCTLA.bit.CAU = AQ_SET; // set actions for EPWM2A
EPwm2Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm2Regs.AQCTLB.bit.CBU = AQ_SET; // set actions for EPWM2B
EPwm2Regs.AQCTLB.bit.CBD = AQ_CLEAR;
//
// Run Time (Note: Example execution of one run-time instance)
//===========================================================
EPwm1Regs.CMPA.half.CMPA = 400; // adjust duty for output EPWM1A
EPwm1Regs.CMPB = 200; // adjust duty for output EPWM1B
EPwm2Regs.CMPA.half.CMPA = 500; // adjust duty for output EPWM2A
EPwm2Regs.CMPB = 300; // adjust duty for output EPWM2B
Slave
Phase reg SyncIn
En VDC_bus
Φ=0° EPWM2A Vout2
EPWM2B
CTR=zero
CTR=CMPB EPWM2A
X
SyncOut
EPWM2B
Figure 3-8. Half-H Bridge Waveforms for Figure 3-7 (Note: Here FPWM2 = FPWM1 )
Z Z Z
I I I
600
400 400
200 200
Z CB CA Z CB CA
A A
EPWM1A
CA CB Z CA CB Z
A A
EPWM1B
Pulse Center
500 500
250 250
Z CB CA Z CB CA
A A
EPWM2A
CA CB Z CA CB Z
A A
EPWM2B
Pulse Center
//=====================================================================
// Config
//=====================================================================
// Initialization Time
//========================
// EPWM Module 1 config
EPwm1Regs.TBPRD = 600; // Period = 1200 TBCLK counts
EPwm1Regs.TBPHS = 0; // Set Phase register to zero
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetrical mode
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Master module
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; // Sync down-stream module
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm1Regs.AQCTLA.bit.ZRO = AQ_SET; // set actions for EPWM1A
EPwm1Regs.AQCTLA.bit.CAU = AQ_CLEAR;
EPwm1Regs.AQCTLB.bit.ZRO = AQ_CLEAR; // set actions for EPWM1B
EPwm1Regs.AQCTLB.bit.CAD = AQ_SET;
// EPWM Module 2 config
EPwm2Regs.TBPRD = 600; // Period = 1200 TBCLK counts
EPwm2Regs.TBPHS = 0; // Set Phase register to zero
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN;// Symmetrical mode
EPwm2Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Slave module
EPwm2Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm2Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; // sync flow-through
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm2Regs.AQCTLA.bit.ZRO = AQ_SET; // set actions for EPWM1A
EPwm2Regs.AQCTLA.bit.CAU = AQ_CLEAR;
EPwm2Regs.AQCTLB.bit.ZRO = AQ_CLEAR; // set actions for EPWM1B
EPwm2Regs.AQCTLB.bit.CAD = AQ_SET;
//============================================================
EPwm1Regs.CMPA.half.CMPA = 400; // adjust duty for output EPWM1A & EPWM1B
EPwm1Regs.CMPB = 200; // adjust point-in-time for ADCSOC trigger
EPwm2Regs.CMPA.half.CMPA = 500; // adjust duty for output EPWM2A & EPWM2B
EPwm2Regs.CMPB = 250; // adjust point-in-time for ADCSOC trigger
3.6 Controlling Dual 3-Phase Inverters for Motors (ACI and PMSM)
The idea of multiple modules controlling a single power stage can be extended to the 3-phase Inverter
case. In such a case, six switching elements can be controlled using three PWM modules, one for each
leg of the inverter. Each leg must switch at the same frequency and all legs must be synchronized. A
master + two slaves configuration can easily address this requirement. Figure 3-9 shows how six PWM
modules can control two independent 3-phase Inverters; each running a motor.
As in the cases shown in the previous sections, we have a choice of running each inverter at a different
frequency (module 1 and module 4 are masters as in Figure 3-9), or both inverters can be synchronized
by using one master (module 1) and five slaves. In this case, the frequency of modules 4, 5, and 6 (all
equal) can be integer multiples of the frequency for modules 1, 2, 3 (also all equal).
Figure 3-9. Control of Dual 3-Phase Inverter Stages as Is Commonly Used in Motor Control
Ext SyncIn
(optional)
Master
Phase reg SyncIn
En
Φ=0° EPWM1A
EPWM1B
CTR=zero
CTR=CMPB
X
1 SyncOut
Slave
Phase reg SyncIn EPWM1A EPWM2A EPWM3A
En
Φ=0° EPWM2A VAB
EPWM2B VCD
CTR=zero
CTR=CMPB VEF
X
2 SyncOut EPWM1B EPWM2B EPWM3B
3 phase motor
Slave
Phase reg SyncIn
En
Φ=0° EPWM3A
3 phase inverter #1
EPWM3B
CTR=zero
CTR=CMPB
X
3 SyncOut
Slave
Phase reg
SyncIn
En
Φ=0° EPWM4A
EPWM4B
CTR=zero
CTR=CMPB
X
4 SyncOut
Slave
Phase reg SyncIn
En 3 phase inverter #2
Φ=0° EPWM6A
EPWM6B
CTR=zero
CTR=CMPB
X
6 SyncOut
Figure 3-10. 3-Phase Inverter Waveforms for Figure 3-9 (Only One Inverter Shown)
Z 800 Z
I I
500 500
CA P CA CA P CA
A A
EPWM1A RED
RED
600 600
Φ2=0
CA CA CA CA
EPWM2A
RED
EPWM2B
FED
700 700
Φ3=0
CA CA CA CA
EPWM3A RED
EPWM3B
FED
//=====================================================================
// Configuration
//=====================================================================
// Initialization Time
//========================// EPWM Module 1 config
EPwm1Regs.TBPRD = 800; // Period = 1600 TBCLK counts
EPwm1Regs.TBPHS = 0; // Set Phase register to zero
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN;// Symmetrical mode
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Master module
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; // Sync down-stream module
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm1Regs.AQCTLA.bit.CAU = AQ_SET; // set actions for EPWM1A
EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm1Regs.DBCTL.bit.MODE = DB_FULL_ENABLE; // enable Dead-band module
EPwm1Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; // Active Hi complementary
EPwm1Regs.DBFED = 50; // FED = 50 TBCLKs
EPwm1Regs.DBRED = 50; // RED = 50 TBCLKs
// EPWM Module 2 config
EPwm2Regs.TBPRD = 800; // Period = 1600 TBCLK counts
EPwm2Regs.TBPHS = 0; // Set Phase register to zero
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetrical mode
EPwm2Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Slave module
EPwm2Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm2Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; // sync flow-through
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm2Regs.AQCTLA.bit.CAU = AQ_SET; // set actions for EPWM2A
EPwm2Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm2Regs.DBCTL.bit.MODE = DB_FULL_ENABLE; // enable Dead-band module
EPwm2Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; // Active Hi complementary
EPwm2Regs.DBFED = 50; // FED = 50 TBCLKs
EPwm2Regs.DBRED = 50; // RED = 50 TBCLKs
// EPWM Module 3 config
EPwm3Regs.TBPRD = 800; // Period = 1600 TBCLK counts
EPwm3Regs.TBPHS = 0; // Set Phase register to zero
EPwm3Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN;// Symmetrical mode
EPwm3Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Slave module
EPwm3Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm3Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; // sync flow-through
EPwm3Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm3Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm3Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm3Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm3Regs.AQCTLA.bit.CAU = AQ_SET; // set actions for EPWM3A
EPwm3Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm3Regs.DBCTL.bit.MODE = DB_FULL_ENABLE; // enable Dead-band module
EPwm3Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; // Active Hi complementary
EPwm3Regs.DBFED = 50; // FED = 50 TBCLKs
EPwm3Regs.DBRED = 50; // RED = 50 TBCLKs
// Run Time (Note: Example execution of one run-time instant)
//=========================================================
EPwm1Regs.CMPA.half.CMPA = 500; // adjust duty for output EPWM1A
EPwm2Regs.CMPA.half.CMPA = 600; // adjust duty for output EPWM2A
EPwm3Regs.CMPA.half.CMPA = 700; // adjust duty for output EPWM3A
EPWM1B
CTR=zero
CTR=CMPB
X
1 SyncOut
Slave
Phase reg SyncIn
En
Φ=120° EPWM2A
EPWM2B
CTR=zero
CTR=CMPB
X
2 SyncOut
Figure 3-12 shows the associated timing waveforms for this configuration. Here, TBPRD = 600 for both
master and slave. For the slave, TBPHS = 200 (i.e., 200/600 X 360° = 120°). Whenever the master
generates a SyncIn pulse (CTR = PRD), the value of TBPHS = 200 is loaded into the slave TBCTR
register so the slave time-base is always leading the master's time-base by 120°.
Figure 3-12. Timing Waveforms Associated With Phase Control Between 2 Modules
FFFFh TBCTR[0-15]
Master Module
600 600
TBPRD
0000
CTR = PRD
time
(SycnOut)
FFFFh TBCTR[0-15]
Φ2 Phase = 120°
Slave Module
600 600
TBPRD
200 200
TBPHS
0000
SyncIn
time
EPWM1B
CTR=zero
CTR=CMPB EPWM1A EPWM2A EPWM3A
X
1 SyncOut
Slave
EPWM1B EPWM2B EPWM3B VOUT
Phase reg SyncIn
En
Φ=120° EPWM2A
EPWM2B
CTR=zero
CTR=CMPB
X
2 SyncOut
Slave
Phase reg SyncIn
En
Φ=240° EPWM3A
EPWM3B
CTR=zero
CTR=CMPB
X
3 SyncOut
Figure 3-14. 3-Phase Interleaved DC/DC Converter Waveforms for Figure 3-13
Z Z Z Z
450
I I I I
285 285
CA P CA CA P CA CA P CA
A A A
300 Φ2=120°
TBPHS
(=300)
EPWM2A
EPWM2B
300 Φ2=120°
TBPHS
(=300)
EPWM3A
EPWM3B
//=====================================================================
// Config
// Initialization Time
//========================
// EPWM Module 1 config
EPwm1Regs.TBPRD = 450; // Period = 900 TBCLK counts
EPwm1Regs.TBPHS = 0; // Set Phase register to zero
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetrical mode
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Master module
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; // Sync down-stream module
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm1Regs.AQCTLA.bit.CAU = AQ_SET; // set actions for EPWM1A
EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm1Regs.DBCTL.bit.MODE = DB_FULL_ENABLE; // enable Dead-band module
EPwm1Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; // Active Hi complementary
EPwm1Regs.DBFED = 20; // FED = 20 TBCLKs
EPwm1Regs.DBRED = 20; // RED = 20 TBCLKs
// EPWM Module 2 config
EPwm2Regs.TBPRD = 450; // Period = 900 TBCLK counts
EPwm2Regs.TBPHS = 300; // Phase = 300/900 * 360 = 120 deg
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetrical mode
EPwm2Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Slave module
EPwm2Regs.TBCTL.bit.PHSDIR = TB_DOWN; // Count DOWN on sync (=120 deg)
EPwm2Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm2Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; // sync flow-through
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm2Regs.AQCTLA.bit.CAU = AQ_SET; // set actions for EPWM2A
EPwm2Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm2Regs.DBCTL.bit.MODE = DB_FULL_ENABLE; // enable Dead-band module
EPwm2Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; // Active Hi Complementary
EPwm2Regs.DBFED = 20; // FED = 20 TBCLKs
EPwm2Regs.DBRED = 20; // RED = 20 TBCLKs
// EPWM Module 3 config
EPwm3Regs.TBPRD = 450; // Period = 900 TBCLK counts
EPwm3Regs.TBPHS = 300; // Phase = 300/900 * 360 = 120 deg
EPwm3Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetrical mode
EPwm3Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Slave module
EPwm2Regs.TBCTL.bit.PHSDIR = TB_UP; // Count UP on sync (=240 deg)
EPwm3Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm3Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; // sync flow-through
EPwm3Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm3Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm3Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm3Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm3Regs.AQCTLA.bit.CAU = AQ_SET; // set actions for EPWM3Ai
EPwm3Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm3Regs.DBCTL.bit.MODE = DB_FULL_ENABLE; // enable Dead-band module
EPwm3Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; // Active Hi complementary
EPwm3Regs.DBFED = 20; // FED = 20 TBCLKs
EPwm3Regs.DBRED = 20; // RED = 20 TBCLKs
// Run Time (Note: Example execution of one run-time instant)
//===========================================================
EPwm1Regs.CMPA.half.CMPA = 285; // adjust duty for output EPWM1A
EPwm2Regs.CMPA.half.CMPA = 285; // adjust duty for output EPWM2A
EPwm3Regs.CMPA.half.CMPA = 285; // adjust duty for output EPWM3A
CTR=zero EPWM1B
CTR=CMPB
X EPWM1A EPWM2A
SyncOut
Slave
Phase reg SyncIn
En
Φ=Var° EPWM2A
EPWM1B EPWM2B
CTR=zero EPWM2B
CTR=CMPB
X
SyncOut
Var = Variable
1200
600
200
ÉÉÉ
ÉÉÉ
Z CB CA Z CB CA Z
A A
ÉÉÉ
ÉÉÉ
ÉÉÉ ÉÉÉ
ÉÉÉ
EPWM1A RED
ZVS transition
ÉÉÉ
Power phase
EPWM1B
ÉÉÉ 300 Φ2=variable
FED
ZVS transition
TBPHS
=(1200−Φ2)
CB CB
ÉÉÉ A
ÉÉÉ
A
ÉÉÉ ÉÉÉ
Z Z Z
CA CA
Power phase
//=====================================================================
// Config
//=====================================================================
// Initialization Time
//========================
// EPWM Module 1 config
EPwm1Regs.TBPRD = 1200; // Period = 1201 TBCLK counts
EPwm1Regs.CMPA = 600; // Set 50% fixed duty for EPWM1A
EPwm1Regs.TBPHS = 0; // Set Phase register to zero
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP; // Asymmetrical mode
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Master module
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; // Sync down-stream module
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm1Regs.AQCTLA.bit.ZRO = AQ_SET; // set actions for EPWM1A
EPwm1Regs.AQCTLA.bit.CAU = AQ_CLEAR;
EPwm1Regs.DBCTL.bit.MODE = DB_FULL_ENABLE; // enable Dead-band module
EPwm1Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; // Active Hi complementary
EPwm1Regs.DBFED = 50; // FED = 50 TBCLKs initially
EPwm1Regs.DBRED = 70; // RED = 70 TBCLKs initially
// EPWM Module 2 config
EPwm2Regs.TBPRD = 1200; // Period = 1201 TBCLK counts
EPwm2Regs.CMPA.half.CMPA = 600; // Set 50% fixed duty EPWM2A
EPwm2Regs.TBPHS = 0; // Set Phase register to zero initially
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP; // Asymmetrical mode
EPwm2Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Slave module
EPwm2Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm2Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; // sync flow-through
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero
EPwm2Regs.AQCTLA.bit.ZRO = AQ_SET; // set actions for EPWM2A
EPwm2Regs.AQCTLA.bit.CAU = AQ_CLEAR;
EPwm2Regs.DBCTL.bit.MODE = DB_FULL_ENABLE; // enable Dead-band module
EPwm2Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; // Active Hi complementary
EPwm2Regs.DBFED = 30; // FED = 30 TBCLKs initially
EPwm2Regs.DBRED = 40; // RED = 40 TBCLKs initially
Registers
This chapter includes the register layouts and bit description for the submodules.
7 6 5 4 3 2 1 0
HSPCLKDIV SWFSYNC SYNCOSEL PRDLD PHSEN CTRMODE
R/W-0,0,1 R/W-0 R/W-0 R/W-0 R/W-0 R/W-11
7 3 2 1 0
Reserved CTRMAX SYNCI CTRDIR
R-0 R/W1C-0 R/W1C-0 R-1
LEGEND: R/W = Read/Write; R = Read only; R/W1C = Read/Write 1 to clear; -n = value after reset
7 6 5 4 3 2 1 0
Reserved SHDWBMODE Reserved SHDWAMODE LOADBMODE LOADAMODE
R-0 R/W-0 R-0 R/W-0 R/W-0 R/W-0
7 0
Reserved
R-0
7 6 5 4 3 2 1 0
CAD CAU PRD ZRO
R/W-0 R/W-0 R/W-0 R/W-0
Table 4-10. Action-Qualifier Output A Control Register (AQCTLA) Field Descriptions (continued)
Bits Name Value Description
7-6 CAD Action when the counter equals the active CMPA register and the counter is decrementing.
00 Do nothing (action disabled)
01 Clear: force EPWMxA output low.
10 Set: force EPWMxA output high.
11 Toggle EPWMxA output: low output signal will be forced high, and a high signal will be forced low.
5-4 CAU Action when the counter equals the active CMPA register and the counter is incrementing.
00 Do nothing (action disabled)
01 Clear: force EPWMxA output low.
10 Set: force EPWMxA output high.
11 Toggle EPWMxA output: low output signal will be forced high, and a high signal will be forced low.
3-2 PRD Action when the counter equals the period.
Note: By definition, in count up-down mode when the counter equals period the direction is defined
as 0 or counting down.
00 Do nothing (action disabled)
01 Clear: force EPWMxA output low.
10 Set: force EPWMxA output high.
11 Toggle EPWMxA output: low output signal will be forced high, and a high signal will be forced low.
1-0 ZRO Action when counter equals zero.
Note: By definition, in count up-down mode when the counter equals 0 the direction is defined as 1
or counting up.
00 Do nothing (action disabled)
01 Clear: force EPWMxA output low.
10 Set: force EPWMxA output high.
11 Toggle EPWMxA output: low output signal will be forced high, and a high signal will be forced low.
7 6 5 4 3 2 1 0
CAD CAU PRD ZRO
R/W-0 R/W-0 R/W-0 R/W-0
Table 4-11. Action-Qualifier Output B Control Register (AQCTLB) Field Descriptions (continued)
Bits Name Value Description
9-8 CBU Action when the counter equals the active CMPB register and the counter is incrementing.
00 Do nothing (action disabled)
01 Clear: force EPWMxB output low.
10 Set: force EPWMxB output high.
11 Toggle EPWMxB output: low output signal will be forced high, and a high signal will be forced low.
7-6 CAD Action when the counter equals the active CMPA register and the counter is decrementing.
00 Do nothing (action disabled)
01 Clear: force EPWMxB output low.
10 Set: force EPWMxB output high.
11 Toggle EPWMxB output: low output signal will be forced high, and a high signal will be forced low.
5-4 CAU Action when the counter equals the active CMPA register and the counter is incrementing.
00 Do nothing (action disabled)
01 Clear: force EPWMxB output low.
10 Set: force EPWMxB output high.
11 Toggle EPWMxB output: low output signal will be forced high, and a high signal will be forced low.
3-2 PRD Action when the counter equals the period.
Note: By definition, in count up-down mode when the counter equals period the direction is defined
as 0 or counting down.
00 Do nothing (action disabled)
01 Clear: force EPWMxB output low.
10 Set: force EPWMxB output high.
11 Toggle EPWMxB output: low output signal will be forced high, and a high signal will be forced low.
1-0 ZRO Action when counter equals zero.
Note: By definition, in count up-down mode when the counter equals 0 the direction is defined as 1
or counting up.
00 Do nothing (action disabled)
01 Clear: force EPWMxB output low.
10 Set: force EPWMxB output high.
11 Toggle EPWMxB output: low output signal will be forced high, and a high signal will be forced low.
7 6 5 4 3 2 1 0
RLDCSF OTSFB ACTSFB OTSFA ACTSFA
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
7 4 3 2 1 0
Reserved CSFB CSFA
R-0 R/W-0 R/W-0
Table 4-13. Action-qualifier Continuous Software Force Register (AQCSFRC) Field Descriptions
Bits Name Value Description
15-4 Reserved Reserved
Table 4-13. Action-qualifier Continuous Software Force Register (AQCSFRC) Field Descriptions
(continued)
Bits Name Value Description
3-2 CSFB Continuous Software Force on Output B
In immediate mode, a continuous force takes effect on the next TBCLK edge.
In shadow mode, a continuous force takes effect on the next TBCLK edge after a shadow load into
the active register. To configure shadow mode, use AQSFRC[RLDCSF].
00 Forcing disabled, i.e., has no effect
01 Forces a continuous low on output B
10 Forces a continuous high on output B
11 Software forcing is disabled and has no effect
1-0 CSFA Continuous Software Force on Output A
In immediate mode, a continuous force takes effect on the next TBCLK edge.
In shadow mode, a continuous force takes effect on the next TBCLK edge after a shadow load into
the active register.
00 Forcing disabled, i.e., has no effect
01 Forces a continuous low on output A
10 Forces a continuous high on output A
11 Software forcing is disabled and has no effect
7 6 5 4 3 2 1 0
Reserved IN_MODE POLSEL OUT_MODE
R-0 R/W-0 R/W-0 R/W-0
7 0
DEL
R/W-0
Table 4-15. Dead-Band Generator Rising Edge Delay Register (DBRED) Field Descriptions
Bits Name Value Description
15-10 Reserved Reserved
9-0 DEL Rising Edge Delay Count. 10-bit counter.
7 0
DEL
R/W-0
Table 4-16. Dead-Band Generator Falling Edge Delay Register (DBFED) Field Descriptions
Bits Name Description
15-10 Reserved Reserved
9-0 DEL Falling Edge Delay Count. 10-bit counter
7 5 4 1 0
CHPFREQ OSHTWTH CHPEN
R/W-0 R/W-0 R/W-0
7 6 5 4 3 2 1 0
Reserved CBC6 CBC5 CBC4 CBC3 CBC2 CBC1
R-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
Table 4-18. Trip-Zone Submodule Select Register (TZSEL) Field Descriptions (continued)
Bits Name Value Description
3 CBC4 Trip-zone 4 (TZ4) Select
0 Disable TZ4 as a CBC trip source for this ePWM module
1 Enable TZ4 as a CBC trip source for this ePWM module
2 CBC3 Trip-zone 3 (TZ3) Select
0 Disable TZ3 as a CBC trip source for this ePWM module
1 Enable TZ3 as a CBC trip source for this ePWM module
1 CBC2 Trip-zone 2 (TZ2) Select
0 Disable TZ2 as a CBC trip source for this ePWM module
1 Enable TZ2 as a CBC trip source for this ePWM module
0 CBC1 Trip-zone 1 (TZ1) Select
0 Disable TZ1 as a CBC trip source for this ePWM module
1 Enable TZ1 as a CBC trip source for this ePWM module
7 4 3 2 1 0
Reserved TZB TZA
R-0 R/W-0 R/W-0
7 3 2 1 0
Reserved OST CBC Reserved
R-0 R/W-0 R/W-0 R-0
7 3 2 1 0
Reserved OST CBC INT
R-0 R-0 R-0 R-0
7 3 2 1 0
Reserved OST CBC INT
R-0 R/W-0 R/W-0 R/W-0
7 3 2 1 0
Reserved OST CBC Reserved
R-0 R/W-0 R/W-0 R- 0
7 4 3 2 0
Reserved INTEN INTSEL
R-0 R/W-0 R/W-0
7 4 3 2 1 0
Reserved INTCNT INTPRD
R-0 R-0 R/W-0
7 4 3 2 1 0
Reserved SOCB SOCA Reserved INT
R-0 R-0 R-0 R-0 R-0
7 4 3 2 1 0
Reserved SOCB SOCA Reserved INT
R-0 R/W-0 R/W-0 R-0 R/W-0
7 4 3 2 1 0
Reserved SOCB SOCA Reserved INT
R-0 R-0 R-0 R-0 R-0
Revision History
This document was revised to SPRU791E from SPRU791D. The scope of the revision was limited to
technical changes as shown in Table A-1.