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.

CCS/TMS320F28377S: TMS320F28377S

Part Number: TMS320F28377S

Tool/software: Code Composer Studio

HOW TO MAKE SURE THAT TWO ePWM MODULES RUN SIMULTANEOUSLY WHICH MEANS TWO COUNTERS MAINTAIN THE SAME VALUE AT EVERY MOMENT WHEN THEY ARE SET UP EXACTLY THE SAME?

  • Hi Wentao,

    There are a variety of features that allow you to maintain synchronization between multiple ePWM modules.

    The simplest thing if both modules are configured identically is to set 'TBCLKSYNC' in the 'PCLKCR0' register to 0 before initializing the modules, then set it to 1 at the very end to start the modules counting at the same time.

    If you want to change values for multiple modules at the same time look at the shadow registers and global load. Most of the key registers are shadowed, so you can setup the next value and have them load at some time (say zero compare). If the timebases are already sync'ed because you started them at the same time, then the register shadow->active updates will also occur synchronously.
  • thanks for your answer. as you said, the multiple ePWM modules clock can be set up synchronously by 'TBCLKSYNC', and if the cmpa and cmpb runs in immediate mode and the multiple ePWM counter maintains the same at every moment, I wanna to use Software Forced Sync Pulse to synchronize different modules. is it correct?
    and assuming that epwm 2 and epwm 6 have to be synchronized and the epwm2 Software Forced Sync Pulse is set up, how to make sure the epwm2synco signal is linked to epwm6? from datasheet, I see EPWMSYNCINSEL Register may help but I don't know how to use it.
    regards,
    zhang wentao
  • Hi Wentao,

    If you want to use the sync in/out pulses to synchronize some load events, then take a look at the diagram "Time-Base Counter Synchronization Scheme" in the TRM ()  This will tell you how all the ePWMs sync signals are connected together and if you need to write any mux settings to connect your specific ePWM modules.

    The diagram "Simplified ePWM Module" also gives a good idea of what events can generate the sync output signal.