www.ti.com
Enhanced PWM (ePWM) Module
Table 15-10. Submodule Configuration Parameters (continued)
Submodule Configuration Parameter or Option
Trip-zone (TZ)
• Configure the ePWM module to react to one, all, or none of the trip-zone pins.
• Specify the tripping action taken when a fault occurs:
– Force EPWMxA and/or EPWMxB high
– Force EPWMxA and/or EPWMxB low
– Force EPWMxA and/or EPWMxB to a high-impedance state
– Configure EPWMxA and/or EPWMxB to ignore any trip condition.
• Configure how often the ePWM will react to each trip-zone pin:
– One-shot
– Cycle-by-cycle
• Enable the trip-zone to initiate an interrupt.
• Bypass the trip-zone module entirely.
Event-trigger (ET) • Enable the ePWM events that will trigger an interrupt.
• Specify the rate at which events cause triggers (every occurrence or every second or third
occurrence)
• Poll, set, or clear event flags
High-Resolution PWM
• Enable extended time resolution capabilities
(HRPWM)
• Configure finer time granularity control or edge positioning
Code examples are provided in the remainder of this chapter that show how to implement various ePWM
module configurations. These examples use the constant definitions shown in Example 15-1.
Example 15-1. Constant Definitions Used in the Code Examples
// TBCTL (Time-Base Control)
// = = = = = = = = = = = = = = = = = = = = = = = = = =
// TBCNT MODE bits
#define TB_COUNT_UP 0x0
#define TB_COUNT_DOWN 0x1
#define TB_COUNT_UPDOWN 0x2
#define TB_FREEZE 0x3
// PHSEN bit
#define TB_DISABLE 0x0
#define TB_ENABLE 0x1
// PRDLD bit
#define TB_SHADOW 0x0
#define TB_IMMEDIATE 0x1
// SYNCOSEL bits
#define TB_SYNC_IN 0x0
#define TB_CTR_ZERO 0x1
#define TB_CTR_CMPB 0x2
#define TB_SYNC_DISABLE 0x3
// HSPCLKDIV and CLKDIV bits
#define TB_DIV1 0x0
#define TB_DIV2 0x1
#define TB_DIV4 0x2
// PHSDIR bit
#define TB_DOWN 0x0
#define TB_UP 0x1
// CMPCTL (Compare Control)
// = = = = = = = = = = = = = = = = = = = = = = = = = =
// LOADAMODE and LOADBMODE bits
#define CC_CTR_ZERO 0x0
#define CC_CTR_PRD 0x1
#define CC_CTR_ZERO_PRD 0x2
#define CC_LD_DISABLE 0x3
1499
SPRUH73H–October 2011–Revised April 2013 Pulse-Width Modulation Subsystem (PWMSS)
Submit Documentation Feedback
Copyright © 2011–2013, Texas Instruments Incorporated