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.

difficulty in synchronization of 2 ePWM module in F28335

i configured 2 ePWM modules in f28335 using simulink.
(1) module 1 is giving 50Hz square wave.
(2) module 2 is giving 20000Hz SPWM wave.
for sync between these two modules, i set SYNCO of PWM1 to CTR=ZERO. Also Synchronization action of PWM2 to zero counter offset.
problem: 20000Hz wave is slowly shifting with respect to 50Hz wave.
p.s. SPWM wave has 50Hz of modulating signal frequency. So both wave should give one constant pattern on oscilloscope.

  • Ashish,

    Have you enabled the SYNC input on PWM2?  If you have you're doing everything right on the chip side.  The PWMs should be aligned and locked.  Your configuration should look something like figure 3-5 in the PWM User's Guide (sprug04a).

    Now, if you're modulating the 20kHz waveform with something else and that is drifting relative to 50kHz, that is a different matter.  Then you need to look at your model / software for a reason.

    I don't have experience with auto-codegen from Simulink so I really can't comment on that.  As I mentioned in your other post, I think it would be worth raising this on The Mathworks forum too.

    Regards,

    Richard