4.3 SFO Library Software - SFO_TI_Build_V6.lib
lists several features of the SFO_TI_Build_V6.lib library.
Table 4-6. SFO Library Features
SYSCLK Freq
SFO_TI_Build_V6.lib
Unit
Maximum HRPWM channels supported
-
8
channels
Total static variable memory size
-
11
words
Completion-checking?
-
Yes
-
Typical time required for SFO() to update MEP_ScaleFactor, if called
repetitively without interrupts
80 MHz
1.3
milliseconds
60 MHz
2.23
milliseconds
Following is a functional description of the SFO library routine, SFO().
4.3.1 Scale Factor Optimizer Function - int SFO()
This routine drives the micro-edge positioner (MEP) calibration module to run SFO diagnostics and determine
the appropriate MEP scale factor (number of MEP steps per coarse SYSCLKOUT step) for a device at any given
time.
If SYSCLKOUT = TBCLK = 90 MHz and assuming the MEP step size is 150 ps, the typical scale factor value at
90 MHz = 74 MEP steps per TBCLK unit (11.1 ns)
The function returns a MEP scale factor value:
MEP_ScaleFactor = Number of MEP steps/SYSCLKOUT.
Constraints when using this function:
• SFO() can be used with a minimum SYSCLKOUT = TBCLK = 50 MHz. MEP diagnostics logic uses
SYSCLKOUT and not TBCLK, so the SYSCLKOUT restriction is an important constraint. Below 50 MHz,
with device process variation, the MEP step size may decrease under cold temperature and high core voltage
conditions to such a point, that 255 MEP steps will not span an entire SYSCLKOUT cycle.
• At any time, SFO() can be called to run SFO diagnostics on the MEP calibration module
Usage:
• SFO() can be called at any time in the background while the ePWM channels are running in HRPWM
mode. The scale factor result obtained in MEP_ScaleFactor can be applied to all ePWM channels running in
HRPWM mode because the function makes use of the diagnostics logic in the MEP calibration module (which
runs independently of ePWM channels).
• This routine returns a 1 when calibration is finished, and a new scale factor has been calculated or a 0 if
calibration is still running. The routine returns a 2 if there is an error, and the MEP_ScaleFactor is greater
than the maximum 255 fine steps per coarse SYSCLKOUT cycle. In this case, the HRMSTEP register will
maintain the last MEP scale factor value less than 256 for auto conversion.
• All ePWM modules operating in HRPWM incur only a 3-SYSCLKOUT cycle minimum duty cycle limitation
when high-resolution period control is not used. If high-resolution period control is enabled, there is an
additional duty cycle limitation 3-SYSCLKOUT cycles before the end of the PWM period (see
).
• In SFO_TI_Build_V6b.lib, the SFO() function also updates the HRMSTEP register with the scale factor
result. If the HRCNFG[AUTOCONV] bit is set, the application software is responsible only for setting
CMPAHR = fraction(PWMduty*PWMperiod)<<8 or TBPRDHR = fraction (PWMperiod) while running SFO()
in the background. The MEP Calibration Module will then use the values in the HRMSTEP and CMPAHR/
TBPRDHR register to automatically calculate the appropriate number of MEP steps represented by
the fractional duty cycle or period and move the high-resolution ePWM signal edge accordingly. In
SFO_TI_Build_V6.lib, the SFO() function does not automatically update the HRMSTEP register. Therefore,
after the SFO function completes, the application software must write MEP_ScaleFactor to the HRMSTEP
register (EALLOW-protected).
High-Resolution Pulse Width Modulator (HRPWM)
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
TMS320x2806x Microcontrollers
397
Copyright © 2022 Texas Instruments Incorporated
Содержание TMS320 2806 Series
Страница 2: ......