FILE: hrpwm_ex10_phaseshift_updown_sfo.c
This example modifies the MEP control registers to show rising and falling edge displacement for high-resolution phase shift with ePWM in Up-down count mode due to the HRPWM control extension of the respective ePWM module.
This example calls the following TI's MEP Scale Factor Optimizer (SFO) software library V8 functions:
int
SFO();
- updates MEP_ScaleFactor dynamically
when HRPWM is in use
- updates HRMSTEP register (exists only
in EPwm1Regs register space) with MEP_ScaleFactor value
- returns 2 if error: MEP_ScaleFactor is
greater than maximum value of 255 (Auto-conversion may not function properly under this
condition)
- returns 1 when complete for the
specified channel
- returns 0 if not complete for the
specified channel
This example only uses 2 EPWMs. If all the EPWMs modules are being used then all the 3
HRPWMCAL modules should be calibrated. Here only one is being calibrated. For more details
you can refer to the bitfield example
C2000Ware\device_support\f28p65x\examples\cpu1\hrpwm_ex1_duty_sfo_v8. This example is
intended to explain the HRPWM capabilities. The code can be optimized for code efficiency.
Refer to TI's Digital power application examples and TI Digital Power Supply software
libraries for details.
External Connections
- Monitor ePWM1A and ePWM2A pins on a high resolution oscilloscope. Monitor HR phase shift between PWM1A and PWM2A within one TBCLK.