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.

TMS320F28335: pwm synchronisation

Part Number: TMS320F28335

Requirement: 8 pwm of 50 Hz and 4 pwm of 100kHz.

4 of the 50Hz pwms are complementary((1a,1b),(4a,4b),(5a,5b),(6a,6b)) to each other and should be synchronised(1a,4a,5a,6a).

2 pwm of 100kHz are complementary to each other((2a,2b),(3a,3b)).

epwm 2a and 3a are of 50 percent duty and epwm 3a will be sinusoidally phase shifted with respect to 2a to achieve a 50 Hz sinusoidally modulated waveform.

Problem:I have to synchronise starting of epwm 2a(100kHz) and 1a(50Hz),but epwm 3a should be phase shifted with respect to epwm 2a

How to do this?

  • Hi Richu,

    You can use the TBPHS (Phase Register) to establish the phase difference between two EPWM module synchronized with each other.  You can refer to Section 3.7, 3.8 of F28335 EPWM TRM. Section 3.8 screenshot is attached just to give you an example configuration.

    Hope this solves your problem.

    Regards

    Himanshu

  • Richu,

    the device only has one sync chain, you have the option to bypass PWM modules, but then that PWM module will lose its ability to share a time base or phase relationship to other PWMs. PWM2 cannot be the master to PWM3 if you want PWM1 to be the master for any PWM after PWM2( ie. PWMs 4/5/6). You could make PWM1 the master to all PWMs, but then you will only be able to update your phase relationship between PWM2 and PWM3 at a rate of 50Hz, which I assume is too slow for you.

    The best solution:

    In your design do PWMs 2 and 3 need to be related to 1/4/5/6? Can you change the order of your PWMs?

    If your system is flexible you should be able to reorder the PWMs and get a better results. Use PWM 1/2/3/4 for you 50 Hz signals, and enable the sync chain between those PWMs, PWM1 will be your master to sync PWMs 2/3/4.Then use PWM5 as a second master PWM for your 100kHz PWMs which will now be PWM 5 and PWM6.

    Regards,
    Cody 

  • I can try changing the order of pwms(system is flexible). But still the starting point of 50Hz pwm and 100khz pwm should be synchronised every 20ms(at 50Hz rate).

  • Richu,

    The clocks shouldn't drift after an initial synchronization, why do you need to sync the 100kHz signals to the 50Hz signals more than once? Do you have a phase relationship that needs to change between them? If not you should be able to sync PWMs 1 and 5 once at start up and they should be good.

    If you do still need them to sync at a rate of 50Hz that too should be possible, you will just leave the sync out pulse of PWM4 as SYNCI. This will cause PWM5 to sync to PWM1. You can then setup PWM5's sync out to be CTR = 0 or PRD which will allow you to maintain a phase relationship between PWMs 5 and 6.

    Note you could see something weird for one cycle when the 50Hz sync happens. Because your signals are integer multiples of each other I don't think you'll have any issues, but you should verify.

    Regards,
    Cody