Operational Description of HRPWM
www.ti.com
336
SPRUI07–March 2020
Submit Documentation Feedback
Copyright © 2020, Texas Instruments Incorporated
High-Resolution Pulse Width Modulator (HRPWM)
(1)
n is the ePWM module number on which the SFO function operates.
for example, n = 1, 2, 3, or 4 for the F2808. Check your device data manual for device configurations.
Table 4-6. SFO Library Routines
Function Description
SFO_MepDis(n) Scale Factor Optimizer with MEP Disabled
This routine runs faster, as the calibration logic works when HRPWM capabilities are disabled; therefore, HRPWM
capabilities cannot be run concurrently when the ePWMn is being used.
If SYSCLKOUT = TBCLK = 100 MHz and assuming MEP steps size is 150 ps
Typical value at 100 MHz = 66 MEP steps per unit TBCLK (10 ns)
The function returns a value in the variable array:
MEP_ScaleFactor[n] = Number of MEP steps/SYSCLKOUT
If TBCLK is not equal to SYSCLKOUT, then the returned value must be adjusted to reflect the correct TBCLK:
MEP steps per TBCLK = MEP_ScaleFactor[n] * (SYSCLKOUT/TBCLK)
(1)
Example: If TBCLK =SYSCLKOUT/2,
MEP steps per TBCLK = MEP_ScaleFactor[n] * (100/50) =66 * 2 = 132
(1)
Constraints when using this function:
SFO_MepDis(n) can be used with SYSCLKOUT from 50 MHz to maximum SYSCLK frequency. MEP diagnostics logic
uses SYSCLKOUT not TBCLK and hence SYSCLKOUT restriction is an important constraint. SFO_MepDis(n) function
does not require a starting Scale Factor value. Additionally, TBCLK must equal SYSCLKOUT.
When to use
If one of the ePWM modules is not used in HRPWM mode, then it can be dedicated to run the SFO diagnostics for the
modules that are running HRPWM mode. Here the single MEP_ScaleFactor value obtained can be applied to other
ePWM modules. This assumes that all HRPWM module’s MEP steps are similar but may not be identical.
The ePWM module that is not active in HRPWM mode is still fully operational in conventional PWM mode and can be
used to drive PWM pins. The SFO function only makes use of the MEP diagnostics logic.
The other ePWM modules operating in HRPWM mode incur only a 3-cycle minimum duty limitation.
SFO_MepEn(n) Scale Factor Optimizer with MEP Enabled
This routine runs slower as the calibration logic is used concurrently while HRPWM capabilities are being used by the
ePWM module.
If SYSCLKOUT = TBCLK = 100 MHz and assuming MEP steps size is 150 ps
Typical value at 100 MHz = 66 MEP steps per unit TBCLK (10 ns)
The function returns a value in the variable array:
MEP_ScaleFactor[n]
(1)
= Number of MEP steps/SYSCLKOUT
= Number of MEP steps/TBCLK
Constraints when using this function:
SFO_MepEn(n) function is restricted to be used with SYSCLKOUT of 60 MHz maximum SYSCLK frequency. MEP
diagnostics logic uses SYSCLKOUT not TBCLK and hence SYSCLKOUT restriction is an important constraint.
SFO_MepEn(n) function does require a starting Scale Factor value.MEP_ScaleFactor[0] needs to be initialized to a
typical MEP step size value. Additionally, TBCLK must equal SYSCLKOUT.
NOTE: SFO_MepEn(n) only supports the following HRPWM configuration:
• HRCNFG[HRLOAD] = 0 (load on CTR = ZERO)
• HRCNFG[EDGMODE] = 10 (falling edge MEP control)
SFO_MepEn(n)_V5B.lib includes an SFO_MepEn(n)_V5(n) function which does
not have this limitation.
When to use
If the application requires all ePWM modules to have HRPWM capability (that is, MEP is operational), then the
SFO_MepEn(n) function can run for each of the active ePWM modules with HRPWM capability.
• In the above case, a 6-cycle MEP inactivity zone exists at the start of the PWM period. See Section 4.2.3.3 on
duty cycle range limitation.
• It is also possible to run the SFO_MepEn(n) function for only one ePWM module and to use the SFO return value
for the other modules. In this case only one ePWM module incurs the 6-cycle limitation, and remaining modules
incur only a 3-cycle minimum duty limitation. See “Duty cycle limitation” section. This assumes that all HRPWM
module’s MEP steps are similar but may not be identical.