This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377D: Initial valure for MEP_ScaleFactor

Part Number: TMS320F28377D
Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE

Hello,

I've read on page 1867 of

SPRUHM8F–December 2013–Revised December 2016

here snapshot

Datasheet says NOT STARTING value for "MEP_ScaleFactor".

I write my code with NO initialization of "MEP_ScaleFactor"

unfortunately "MEP_ScaleFactor" start with NEGATIVE value (for example -11) ...

I run my code and

1. SFO() return SFO_ERROR

2. SFO() write -32768 in MEP_ScaleFactor

What is the question ?

  • Mauro,

    You are right that MEP_ScaleFactor does not need to be initialized by the user code. The HRPWM examples using the SFO library (ie hrpwm_duty_sfo_v8, etc) found in controlSUITE and C2000Ware also do not initialize this variable. You may be missing other necessary code. You can refer to the HRPWM examples in either of the following directories for configuration and usage of the SFO library:

    C:\ti\controlSUITE\device_support\F2837xD\v210\F2837xD_examples_Cpu1\
    C:\ti\c2000\C2000Ware_1_00_00_00\device_support\f2837xd\examples\cpu1\

    Thanks,
    Elizabeth
  • Ok, but if SFO set MEP_ScaleFactor to -32768 and return always SFO_ERROR,
    it is important to initialize MEP_ScaleFactor at least to random positive value ...
  • Mauro,

    Have you tried debugging the HRPWM examples I discussed above? Is the return SFO_ERROR when debugging them?
    If SFO returns error in your application but passes in the given examples, then it's likely the configuration code is incomplete or the EPWMCLK constraints are not met.

    The configuration code can be found in the HRPWM example projects. To use SFO, TBCLK must equal EPWMCLK. Also EPWMCLK must be greater than 50MHz and less than or equal to 100MHz.

    Thanks,
    Elizabeth
  • I've missed

    "CpuSysRegs.PCLKCR2.bit.EPWM1 = 1;" ....

    but this means that you have to turn on clock of EPwms linked in struct

    "volatile struct EPWM_REGS *ePWM[] = {0, &EPwm1Regs};"

    ??
  • Yes, the clocks of the EPWMs being used should be turned on by setting the corresponding bits of the PCLKCR2 register.
    Let me know if you have other questions related to SFO configuration.

    Elizabeth