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.

TMS320F28379D: PWM synchronization signals

Part Number: TMS320F28379D

Hi,

I am trying to synchronize the TBCTR for multiple PWMs.  I was able to get the system working for ePWM1 and ePWM2 where ePWM1:SYNCOSEL  = 0  and  ePWM2:SYNCOSEL  = 2.  I want to setup a similar synchronization with ePWM5 and ePWM6.  The synchronization works properly when the SYNCOSEL on both 5 and 6 is 0 and PHSEN is 1.  But does not work with ePWM5:SYNCOSEL  = 0  and  ePWM6:SYNCOSEL  = 2 . I was curious if it is not possible to have two PWM channels providing separate synchronization signals  ( syncosel = 1 or 2).  

Thank you,

Aditya

  • Hi Aditya,

    Can you please describe what your SYNCOSEL for epwm 4 is as well as EPWM4SYNCIN, are they just set to the default?

    What is your complete sync chain? 

    But does not work with ePWM5:SYNCOSEL  = 0  and  ePWM6:SYNCOSEL  = 2

    SYNCOSEL simply determines what would be the Sync pulse coming out of the module. Are you seeing that epwm6 is no longer in sync with epwm5?

    Best Regards,

    Marlyn

  • Hi Marlyn,

    The SYNCOSEL for epwm4 (and all others which I am not using) is just set to default (0).

    I also realized I made a mistake above.  The system works when But does not work with ePWM5:SYNCOSEL  = 2(or1)  and  ePWM6:SYNCOSEL  = 0.  When I select this I see approximately a 2 EPWM cycle ( 20ns) delay between the signals.

    The complete sync chain that I am trying to implement is ePWM2 synchronized with ePWM1 and ePWM6 synchronized with ePWM5.

    Thank you,

    Aditya

  • Hi Aditya,

    Are you using high resolution period mode? Note that we have comments in the Technical Reference Manual that address the synchronization SYNCOSEL options when in this mode.

    When I select this I see approximately a 2 EPWM cycle ( 20ns) delay between the signals.

    Do you get the same results for both SYNCOSEL 2 and 1? What phase value are you setting for ePWM6?

    Best Regards,

    Marlyn

  • Hi Marlyn,

    I am using phase value of 1 as I need the PWMs to be synchronized exactly.  I went through the documentation for SYNCOSEL options in the Technical Reference Manual, so I am guessing using the ePWM 1 to synchronize all PWMs would be an option.  However I was not able to find information about operating two PWMs on independant time counters with their own sync signal.

    Thanks,

    Aditya

  • Hi Aditya,

    Do you have any configuration differences between epwm 1/2 and epwm 5/6?

    Also, do you get the same results for both SYNCOSEL 2 and 1?

    Best Regards,

    Marlyn

  • Hi Marlyn,

    The TBCTL configuration for 1/2 and 5/6 is the same (except the syncosel = 1) for pwm 1 and 0 for others. I had to make a few changes to how the PWM was used and so the SYNCOSEL =2 cannot be used due to a varying CMPB so I could only test the case for SYNCOSEL =1. I forgot mention before that I am not using the high resolution mode.

    Thanks,
    Aditya

  • Hi Aditya,

    Thank you for providing the information. I tested it on my side and I do not see any issues with trying to synchronize epwm2 to epwm1 and epwm5 to epwm6 when SYNCOSEL=1.

    Would you please check your clock prescalers?

    Below is the setting that I have. If you are not using a divider then you may need to increase your phase value. 

        EPWM_setClockPrescaler(base,
                               EPWM_CLOCK_DIVIDER_8,
                               EPWM_HSCLOCK_DIVIDER_1);

    Also, keep in mind that if you are using up-down count then you will have to take this into account as well.

    Best Regards,

    Marlyn

  • Hi Marlyn,

    Thanks a lot for the help.  I realized that I had not properly configured TBPHS register.   I am using a lower clock divider, I am not sure if that was making the problem worse.  Setting the correct TBPHS according to 15.4.3.3 to account for the delay between the channels solved the issue and I am able to independently configure the two sets of PWM.  

    Thanks again for all the help,

    Aditya