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.

LAUNCHXL-F28379D: ePWM phaseshift(or phasedelay) between ePWM1 & ePWMx not predicatble in the ""Up-Down" Counting mode

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Hello, 

I am trying to syncronize  2 ePWM blocks for a specific phaseshift.

I am using the ePWM blocks from the C2000 blockset.

I have modified the following example to suit my case: 

Using Time-Base Counter Synchronization to Synchronize ePWMs and eCAPS - MATLAB & Simulink - MathWorks Switzerland

I have attached the modified model *.slx and the *.m files for your reference.  

“modi_f2837x_TimeBaseSync.slx”

“modi_c28xgetPhaseOffsetValue_modi.m”

My objective is to vary the phase between 2 ePWM blocks,   in my case ePWM1 & ePWM4 in the "Up-Down" counting mode. 

The examples provided seem to work fine for “Up” or “Down” Counting mode, i,e I see the correct phaseshift between ePWM1 and ePWM4 for different values for phaseDelay = 90, 120,180 etc.,

But in the case of “Up-Down” Counting mode, the phase-shift between ePWM1 and ePWM4. Is indeterministic/unpredictable.

 

Testcase:

TimePeriod = 2.5e-6;

duty_cycle = 50%;

cpuFrequency = 200MHz;

epwmFrequency = 200MHz;

phaseDelay = 180;

The screen shot shows the measurement done on PWM1A & PWM4A @ 100MS/sec with a logic analyzer, also cross checked with at CRO.