Pulse 280 Specifications Page 21

  • Download
  • Add to my manuals
  • Print
  • Page
    / 42
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 20
www.ti.com
Operational Description of HRPWM
Table 7. Factor Values
Software function calls Functional description Updated Variable
MEP_ScaleFactor[5]
(1)
SFO_MepDis(n)
SFO_MepDis(1); Returns the scale factor value to array index 1 MEP_ScaleFactor[1]
SFO_MepDis(2); Returns the scale factor value to array index 2 MEP_ScaleFactor[2]
SFO_MepDis(3); Returns the scale factor value to array index 3 MEP_ScaleFactor[3]
SFO_MepDis(4); Returns the scale factor value to array index 4 MEP_ScaleFactor[4]
SFO_MepEn(n)
SFO_MepEn(1); Returns the scale factor value to array index 1 MEP_ScaleFactor[1]
SFO_MepEn(2); Returns the scale factor value to array index 2 MEP_ScaleFactor[2]
SFO_MepEn(3); Returns the scale factor value to array index 3 MEP_ScaleFactor[3]
SFO_MepEn(4); Returns the scale factor value to array index 4 MEP_ScaleFactor[4]
(1)
MEP_ScaleFactor[0] variable is a starting value and used by the SFO software functions internally
To use the HRPWM feature of the ePWMs it is recommended that the SFO functions be used as
described here.
Step 1. Add Include Files
The SFO.h file needs to be included as follows. This include file is mandatory while using the SFO library
function. For theTMS320F280x devices, the C280x C/C++ Header Files and Peripheral Examples
(literature number SPRC191). DSP280x_Device.h and DSP280x_PWM_defines.h are necessary as they
are used with all TI software examples. These include files are optional if customized header files are
used in the end applications.
Example 1. A Sample of How to Add Include Files
#include "DSP280x_Device.h" // DSP280x Headerfile
#include "DSP280x_EPWM_defines.h" // init defines
#include "SFO.h" // SFO lib functions (needed for HRPWM)
Step 2. Element Declaration
Declare a 5-element array of integer variables as follows:
Example 2. Declaring an Element
int MEP_ScaleFactor[5] = {0,0,0,0,0}; // Scale factor values for ePWM1-4
int MEP_ScaleFactor1, MEP_ScaleFactor2, MEP_ScaleFactor3, MEP_ScaleFactor4 // Not required by library
volatile struct EPWM_REGS *ePWM[] = {0, &EPwm1Regs, &EPwm2Regs, &EPwm3Regs, &EPwm4Regs};
Step 3. MEP_ScaleFactor Initialization
After power up, the SFO_MepEn(n) function needs a starting Scale Factor value. This value can be
conveniently determined by using one of the ePWM modules to run the SFO_MepDis(n) function prior to
configuring its PWM outputs for the application. SFO_MepDis(n) function does not require a starting Scale
Factor value.
As part of the one-time initialization code, include the following:
Example 3. Initializing With a Scale Factor Value
// MEP_ScaleFactor variables initialized using function SFO_MepDis
while (MEP_ScaleFactor[1] == 0) SFO_MepDis(1); //SFO for HRPWM1
while (MEP_ScaleFactor[2] == 0) SFO_MepDis(2); //SFO for HRPWM2
21
SPRU924F April 2005 Revised October 2011 High-Resolution Pulse Width Modulator (HRPWM)
Submit Documentation Feedback
Copyright © 20052011, Texas Instruments Incorporated
Page view 20
1 2 ... 16 17 18 19 20 21 22 23 24 25 26 ... 41 42

Comments to this Manuals

No comments