4.2.3.4.1 High-Resolution Period Configuration
To use High Resolution Period, the ePWMx module must be initialized, following the steps in this exact order:
1. Enable ePWMx clock
2. Disable TBCLKSYNC
3. Configure ePWMx registers - AQ, TBPRD, CC, etc.
• ePWMx may only be configured for up-count or up-down count modes. High-resolution period is not
compatible with down-count mode.
• TBCLK must equal SYSCLKOUT
• TBPRD and CC registers must be configured for shadow loads.
• CMPCTL[LOADAMODE]
– In up-count mode:CMPCTL[LOADAMODE] = 1 (load on CTR = PRD)
– In up-down count mode: CMPCTL[LOADAMODE] = 2 (load on CTR=0 or CTR=PRD)
4. Configure HRPWM register such that:
• HRCNFG[HRLOAD] = 2 (load on either CTR = 0 or CTR = PRD)
• HRCNFG[AUTOCONV] = 1 (Enable auto-conversion)
• HRCNFG[EDGMODE] = 3 (MEP control on both edges)
5. For TBPHS: TBPHSHR synchronization with high-resolution period, set both HRPCTL[TBPSHRLOADE] = 1
and TBCTL[PHSEN] = 1. In up-down count mode these bits must be set to 1 regardless of the contents of
TBPHSHR.
6. Enable high-resolution period control (HRPCTL[HRPE] = 1)
7. Enable TBCLKSYNC
8. TBCTL[SWFSYNC] = 1
9. HRMSTEP must contain an accurate MEP scale factor (# of MEP steps per SYSCLKOUT coarse step)
because auto-conversion is enabled. The MEP scale factor can be acquired via the SFO() function
described in
10. To control high-resolution period, write to the TBPRDHR(M) registers.
Note
When high-resolution period mode is enabled, an EPWMxSYNC pulse will int/- 1 - 2 cycle
jitter to the PWM (+/- 1 cycle in up-count mode and +/- 2 cycle in up-down count mode). For this
reason, TBCTL[SYNCOSEL] should not be set to 1 (CTR = 0 is EPWMxSYNCO source) or 2 (CTR
= CMPB is EPWMxSYNCO source). Otherwise, the jitter will occur on every PWM cycle with the
synchronization pulse.
When TBCTL[SYNCOSEL] = 0 (EPWMxSYNCI is EPWMxSYNCO source), a software
synchronization pulse should be issued only once during high-resolution period initialization. If a
software sync pulse is applied while the PWM is running, the jitter will appear on the PWM output at
the time of the sync pulse.
High-Resolution Pulse Width Modulator (HRPWM)
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
TMS320x2806x Microcontrollers
391
Copyright © 2022 Texas Instruments Incorporated
Содержание TMS320 2806 Series
Страница 2: ......