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.

TMS320F28377D: ePWM synchronization (ePWM3/4)

Part Number: TMS320F28377D

EPWM4 cannot receive sync signal from ePWM3 according to 2837xd ePWM datasheet if I understand rightly. 

The synchronization is needed for MOSFET logic drive while EPWM1 is not available for sync purpose in my application. In addition, ePWM3 and ePWM4 frequency is variable.

1.  I use "CpuSysRegs.PCLKCR0.bit.TBCLKSYNC" like below to sync at first.

But is it reliable? Will the synchronization failure occur due to a long time running or under some other circumstance?

....
EALLOW;
CpuSysRegs.PCLKCR0.bit.TBCLKSYNC=0;
......// configure ePWM modules......
CpuSysRegs.PCLKCR0.bit.TBCLKSYNC=1;
EDIS;
.....

2. Is there any other simple way for synchronization between ePWM4 and ePWM3?

Thanks very much.

  • Hi,

    Method 1 can be used to globally synchronize the time-base clocks of all enabled PWM modules. For perfectly synchronized TBCLKs, the prescaler bits in the TBCTL register of each ePWM module must be set identically. Refer section 14.4.4 of TRM for more details.

    Thanks
    Vasudha
  • Thanks for your quick reply. I have noticed prescaler bit and thanks for reminding.
    It is been used in my application now. But I just want to make sure if there is some hidden danger in this method.
    1. If the TBCLK are synchronized and TBPRD are updated the same time in shadow mode among PWM modules, will the TBCTR be synchronized all the time?
    2. May I change TBPHS under this circumstance?
    If it is YES to both questions, I think I can use this method instead of TBCTR synchronization scheme described in Figure14-7 of TRM.
    Thanks
  • Hi,

    TBPHS is used only when synchronization is enabled. For your case I think, you still need synchronization to be enabled.
    Your understanding is correct - ePWM4 cannot receive sync from ePWM3.
    Is it possible to pick different PWM instances that have a direct Sync connection?
  • Hi,

    Regarding ePMW4 can't receive sync from ePWM3. Not at all. EXTSYNCIN1 using input mux can be tied to any pin including for example ePWM3 or ePWM4 output... No problems to sync them.

    Edit: Is one time sync enough? Then pulsing any unbound or unused pin input-muxed to EXTSYNCIN1 should be enough.


    Edward

  • Edward,
    Both EPWM3 and EPWM4 can receive EXTSYNCIN1.
    Please refer to Figure 14-7. Time-Base Counter Synchronization Scheme in device TRM.
    The Sync chain is split between EPWM3 and EPWM4 - unlike, for example, EPWM2 and EPWM3.
    Also, for sync out generation - not all PWMs can be sources, as shown in the diagram.
    Refer to Table 14-130. SYNCSELECT Register Field Descriptions for possible Sync output selections.
  • Hi,

    • The Sync chain is split between EPWM3 and EPWM4 - unlike, for example, EPWM2 and EPWM3.

    That's not problem. EXTSYNCIN1 can be passed through ePWM1 and ePWM2 to eWPM3, as well through SYNCSELEPWM4SYNCIN to ePWM4. No problem syncing.

    • Also, for sync out generation - not all PWMs can be sources, as shown in the diagram.

    Yes, but no difference if we sync ePWM3 from ePWM4 or ePWM4 from ePWM3. Showstopper here would be requirement for complementary output from ePWM4, since ePWM4A pin (GPIO6) is the same pin like EXTSYNCOUT. On BGA package ePWM4A could be outputted to GPIO151, then GPIO6 could be available to output EXTSYNCOUT and tie-mux here EXTSYNCIN1.

    Edward

  • Hi Edward,

    Are you referring to the same application as Dong Feng mentioned above? Or is the comment for your application?

    "That's not problem. EXTSYNCIN1 can be passed through ePWM1 and ePWM2 to eWPM3, as well through SYNCSELEPWM4SYNCIN to ePWM4. No problem syncing."

    >> If your application allows this then it can be used. But, When you try to sync EPWM3 to EPWM4 (original question) - EPWM3 could be the module generating the source of Sync. Or, in the application, EPWM1 and EPWM2 could be on independent sync chain - in which case "EXTSYNCIN1 can be passed through ePWM1 and ePWM2 to eWPM3" is not feasible.
    Anyway, if it is allowed in your application you can use it.
  • Hi,

    Regarding independent EPWM1/EPWM2 sync chain. Only EPWM1 was mentioned. Even if EPWM1 had its own reqs, you don't know is it fixed freq or not, perhaps reconfiguring sync chain to sync EPWM1, then turning EPWM1.PHSEN off would be enough? Yes, of course, there could be a lot of various requirements to meet. I just mentioned that there's still possibility to sync EPWM3 with EPWM4, even if they are on different corners of sync chain diagram. Even if they were on the same chain, like EPWM2 and EPWM3, variable frequency still may be tricky.

    Edward
  • Dong Feng, Let us know if this resolved your issue or if you need any additional information.
  • Hi,
    I dont think my questions are answered directly here. But I have got help from you FAE.
    Basically it can be synchronized but only with constant phase error as a conclusion.
    thanks for yr time.