Chapter 15 Pulse-Width Modulation Subsystem (PWMSS).
Chapter 15 Pulse-Width Modulation Subsystem (PWMSS).
Chapter 15 Pulse-Width Modulation Subsystem (PWMSS).
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Enhanced PWM (ePWM) Module www.ti.com<br />
Example <strong>15</strong>-1. Constant Definitions Used in the Code Examples (continued)<br />
#define ET_CTRD_CMPB 0x7<br />
// ETPS (Event-trigger Prescale)<br />
// = = = = = = = = = = = = = = = = = = = = = = = = = =<br />
// INTPRD, SOCAPRD, SOCBPRD bits<br />
#define ET_DISABLE 0x0<br />
#define ET_1ST 0x1<br />
#define ET_2ND 0x2<br />
#define ET_3RD 0x3<br />
<strong>15</strong>.2.2.2 Proper Interrupt Initialization Procedure<br />
When the ePWM peripheral clock is enabled it may be possible that interrupt flags may be set due to<br />
spurious events due to the ePWM registers not being properly initialized. The proper procedure for<br />
initializing the ePWM peripheral is:<br />
1. Disable global interrupts (CPU INTM flag)<br />
2. Disable ePWM interrupts<br />
3. Initialize peripheral registers<br />
4. Clear any spurious ePWM flags<br />
5. Enable ePWM interrupts<br />
6. Enable global interrupts<br />
<strong>15</strong>.2.2.3 Time-Base (TB) Submodule<br />
Each ePWM module has its own time-base submodule that determines all of the event timing for the<br />
ePWM module. Built-in synchronization logic allows the time-base of multiple ePWM modules to work<br />
together as a single system. Figure <strong>15</strong>-9 illustrates the time-base module's place within the ePWM.<br />
EPWMxSYNCI<br />
EPWMxSYNCO<br />
Time-Base<br />
(TB)<br />
Counter<br />
Compare<br />
(CC)<br />
Figure <strong>15</strong>-9. Time-Base Submodule Block Diagram<br />
CTR = PRD<br />
CTR = 0<br />
CTR_Dir<br />
CTR = CMPA<br />
CTR = CMPB<br />
Action<br />
Qualifier<br />
(AQ)<br />
EPWMxA<br />
EPWMxB<br />
Interrupt<br />
controller<br />
CTR = PRD<br />
CTR = 0<br />
CTR = CMPA<br />
CTR = CMPB<br />
Dead<br />
Band<br />
(DB)<br />
CTR_Dir<br />
PWMchopper<br />
(PC)<br />
CTR = 0<br />
EPWMxTZINT<br />
Event<br />
Trigger<br />
and<br />
Interrupt<br />
(ET)<br />
Trip<br />
Zone<br />
(TZ)<br />
EPWMxINT<br />
EPWMxA<br />
EPWMxB<br />
TZ1 to TZn<br />
Interrupt<br />
controller<br />
1630 <strong>Pulse</strong>-<strong>Width</strong> <strong>Modulation</strong> <strong>Subsystem</strong> (<strong>PWMSS</strong>) SPRUH73E–October 2011–Revised May 2012<br />
Submit Documentation Feedback<br />
Copyright © 2011–2012, Texas Instruments Incorporated<br />
GPIO<br />
MUX