01.08.2013 Views

Chapter 15 Pulse-Width Modulation Subsystem (PWMSS).

Chapter 15 Pulse-Width Modulation Subsystem (PWMSS).

Chapter 15 Pulse-Width Modulation Subsystem (PWMSS).

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Enhanced PWM (ePWM) Module www.ti.com<br />

<strong>15</strong>.2.2.4.3 Operational Highlights for the Counter-Compare Submodule<br />

The counter-compare submodule is responsible for generating two independent compare events based on<br />

two compare registers:<br />

1. CTR = CMPA: Time-base counter equal to counter-compare A register (TBCNT = CMPA).<br />

2. CTR = CMPB: Time-base counter equal to counter-compare B register (TBCNT = CMPB).<br />

For up-count or down-count mode, each event occurs only once per cycle. For up-down-count mode each<br />

event occurs twice per cycle, if the compare value is between 0000h and TBPRD; and occurs once per<br />

cycle, if the compare value is equal to 0000h or equal to TBPRD. These events are fed into the actionqualifier<br />

submodule where they are qualified by the counter direction and converted into actions if<br />

enabled. Refer to Section <strong>15</strong>.2.2.5.1 for more details.<br />

The counter-compare registers CMPA and CMPB each have an associated shadow register. Shadowing<br />

provides a way to keep updates to the registers synchronized with the hardware. When shadowing is<br />

used, updates to the active registers only occurs at strategic points. This prevents corruption or spurious<br />

operation due to the register being asynchronously modified by software. The memory address of the<br />

active register and the shadow register is identical. Which register is written to or read from is determined<br />

by the CMPCTL[SHDWAMODE] and CMPCTL[SHDWBMODE] bits. These bits enable and disable the<br />

CMPA shadow register and CMPB shadow register respectively. The behavior of the two load modes is<br />

described below:<br />

• Shadow Mode: The shadow mode for the CMPA is enabled by clearing the CMPCTL[SHDWAMODE]<br />

bit and the shadow register for CMPB is enabled by clearing the CMPCTL[SHDWBMODE] bit. Shadow<br />

mode is enabled by default for both CMPA and CMPB.<br />

If the shadow register is enabled then the content of the shadow register is transferred to the active<br />

register on one of the following events:<br />

– CTR = PRD: Time-base counter equal to the period (TBCNT = TBPRD).<br />

– CTR = 0: Time-base counter equal to zero (TBCNT = 0000h)<br />

– Both CTR = PRD and CTR = 0<br />

Which of these three events is specified by the CMPCTL[LOADAMODE] and CMPCTL[LOADBMODE]<br />

register bits. Only the active register contents are used by the counter-compare submodule to generate<br />

events to be sent to the action-qualifier.<br />

• Immediate Load Mode: If immediate load mode is selected (TBCTL[SHADWAMODE] = 1 or<br />

TBCTL[SHADWBMODE] = 1), then a read from or a write to the register will go directly to the active<br />

register.<br />

<strong>15</strong>.2.2.4.4 Count Mode Timing Waveforms<br />

The counter-compare module can generate compare events in all three count modes:<br />

• Up-count mode: used to generate an asymmetrical PWM waveform.<br />

• Down-count mode: used to generate an asymmetrical PWM waveform.<br />

• Up-down-count mode: used to generate a symmetrical PWM waveform.<br />

To best illustrate the operation of the first three modes, the timing diagrams in Figure <strong>15</strong>-19 to Figure <strong>15</strong>-<br />

22 show when events are generated and how the EPWMxSYNCI signal interacts.<br />

1642 <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

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!