Specifications
Software Usage
www.ti.com
Table 13. SFO V5 Library Routines (continued)
Function Description
If it returns a 2, the MEP_ScaleFactor for the channel has finished updating and is outside the
typical drift range of MEP_ScaleFactor[0] +/- 15 even with large temperature and voltage variaitions.
If the reason for large difference between the seed and the channel scale factor is known and
acceptable, the user may choose to ignore the return value of 2, and treat it as a return value of 1,
indicating that calibration is complete.
Otherwise, if the large difference is unexpected, there are steps to take to remedy the error:
1. Check your code to ensure SFO_MepEn_V5(n) is not being called on more than one channel at a
time.
2. If the above is not effective, run SFO_MepDis_V5(n) again and re-seed Mep_ScaleFactor[0].
3. If neither of the above 2 steps work, there may be a system problem. The application firmware
should perform shutdown or an appropriate recovery procedure.
• It is possible to run the SFO_MepEn_V5(n) function for only one ePWM module and to use the
MEP_ScaleFactor value for that module for the other modules also. In this case only one
ePWM module incurs the 6-cycle duty limitation, and the remaining modules incur only a
3-cycle minimum duty limitation. This assumes that all HRPWM modules' MEP steps are
similar but may not be identical.
A.2 Software Usage
Software library functions int SFO_MepEn_V5(int n) and int SFO_MepDis_V5(int n) calculate the MEP
scale factor for ePWMn Modules, where n= the ePWM channel number. The scale factor value, which
represents the number of micro-steps available in a system clock period, is returned in a global array of
integer values called MEP_ScaleFactor[x], where x is he maximum numver of HRPWM channels for a
device plus one. For example, if the maximum number of HRPWM channels for a device is 16, the scale
factor array would be MEP_ScaleFactor[17]. Both SFO_MepEn_V5 and SFO_MepDis_V5 themselves
also return a 1 when calibration has completed, indicating the MEP_ScaleFactor has been successfully
updated for the channel, and a 0 when calibration is still on-going. A return of 2 represents an out-of-range
error.
Table 14. Software Functions
Software functional calls Functional Description
int SFO_MepDis_V5(int n)
(1)
status = SFO_MepDis_V5(1) The scale factor in MEP_ScaleFactor[1] updated when status = 1.
status = SFO_MepDis_V5(2) The scale factor in MEP_ScaleFactor[2] updated when status = 1.
... ...
status = SFO_MepDis_V5(16) The scale factor in MEP_ScaleFactor[16] updated when status = 1 or 2.
int SFO_MepEn_V5(int n)
(1)
status = SFO_MepEn_V5(1) The scale factor in MEP_ScaleFactor[1] updated when status = 1 or 2.
status = SFO_MepEn_V5(2) The scale factor in MEP_ScaleFactor[2] updated when status = 1 or 2.
... ...
status = SFO_MepEn_V5(16) The scale factor in MEP_ScaleFactor[16] updated when status = 1 or 2.
(1)
MEP_ScaleFactor[0] is a starting seed value used by the SFO software functions internally.
To use the HRPWM feature of the ePWMs, it is recommended that the SFO functions in TI_Build_V5.lib
be used as described here. The examples below are specific to the TMS320F28044 device, which
includes a maximum of 16 HRPWM channels. For different devices which may have fewer HRPWM
channels, modifications will be required in Step 1 and Step 2 below.
36
SFO Library Software - SFO_TI_Build_V5.lib SPRU924F– April 2005– Revised October 2011
Submit Documentation Feedback
Copyright © 2005–2011, Texas Instruments Incorporated