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.

TMS320F28375D: synching non sequential PWMs

Part Number: TMS320F28375D

I need to use EPWM6, EPWM7, EPWM8, and EPWM11 and synchronize them. (Because the 100 pin package does not have all of the PWMs available.). How can I do this?  I was thinking of using EPWM4 to synchronize everything by 

configuring EPWM4 and enable its interrupt.

configuring EPWM10 and enable its interrupt.

configure EPWM6, EPWM7,  EPWM8, and EPWM11 

then do

    //EPWM4->EWPM7

    SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_EPWM7,

                              SYSCTL_SYNC_IN_SRC_EPWM4SYNCOUT);

    //EPWM4->EWPM10

    SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_EPWM10,

                              SYSCTL_SYNC_IN_SRC_EPWM4SYNCOUT);

Make ISRs for EPWM4, EPWM7, and EPWM10 to acknowledge the interrupt (is this necessary?)

Do I also need to configure EPWM5 so the synch signal from EPWM4 goes to EPWM6?  Is there anything else I have to do to make this work?

  • 6th Sep is a holiday in US and hence please expect a delay in response.

  • Hi Niel,

    For EPWM 4, you'll need to select EPWM4SYNCIN source through the following function to either be EPWM 1 SYNCOUT, EXTSYNCIN1, or EXTSYNCIN2:

        //
        // Ex. ePWM4 uses the ePWM 1 SYNCO as its SYNCIN.
        //
        SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_EPWM4, SYSCTL_SYNC_IN_SRC_EPWM1SYNCOUT);

    You can then propagate EPWM 4 SYNCOUT to be the SYNCIN for EPWM7 and EPWM10 as you showed:

    SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_EPWM7,SYSCTL_SYNC_IN_SRC_EPWM4SYNCOUT);
    SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_EPWM10,SYSCTL_SYNC_IN_SRC_EPWM4SYNCOUT);

    You need basic configuration of EPWM1 (if you choose EPWM1 SYNCOUT as EPWM4 SYNCIN), EPWM4, EPWM5, and EPWM 10.

    For EPWM modules that are part of your sync chain (EPWM6, EPWM7, EPWM8, and EPWM11) you need to enable the phase shift and provide a phase shift value (Ex. EPWM_enablePhaseShiftLoad(EPWM6_BASE); and EPWM_setPhaseShift(EPWM6_BASE, 900);). On modules like EPWM5, and EPWM10 where you aren't setting/enabling a phase shift value, you need to configure the SYNCOUT to be the same as the SYNC IN [Ex. EPWM_setSyncOutPulseMode(EPWM5_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN);] to allow the sync signal to propagate through. 

    Best Regards,

    Marlyn

  • Marlyn,

    This is very helpful.  I had a few lingering questions

    Do I need to run EPWM1 if everything can trigger off of EPWM4?

    If I can do just EPWM4, what is the minimum configuration I need to have it run at the right rate and trigger the rest of the EPWMs?

    So if EPWM4, EPWM7, and EPWM10 are all synchronized with 

    SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_EPWM7,SYSCTL_SYNC_IN_SRC_EPWM4SYNCOUT);
    SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_EPWM10,SYSCTL_SYNC_IN_SRC_EPWM4SYNCOUT);

    I can do what you suggest and feed the synchout to the same as synchin -- should I do the same for all EPWMs that are not triggered by other PWMs?  Shouldn't I do

    EPWM_setSyncOutPulseMode(EPWM5_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN);
    EPWM_setSyncOutPulseMode(EPWM6_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN);
    EPWM_setSyncOutPulseMode(EPWM8_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN);
    EPWM_setSyncOutPulseMode(EPWM11_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN);
    

    Explanation: Because Epwm4 triggers EPWM7 and EPWM10 -- they do not need a sychin

    If you look at the chart above, EPWM5, and EPWM6 need to be triggered by EPWM4.

    EPWM8 needs to be triggered by EPWM7 (but I can ignore EPWM9 because it is not used and triggers nothing)

    EPWM11 needs to be triggered by EPWM10 (but again, I can ignore EPWM12)

    Am I thinking about this correctly?

    Regards,

    Neil

  • Hi Neil,

    Do I need to run EPWM1 if everything can trigger off of EPWM4?

    No, you do not need to configure EPWM1.

    If I can do just EPWM4, what is the minimum configuration I need to have it run at the right rate and trigger the rest of the EPWMs?

    The EPWM module has many submodules, for EPWM4 you should only need to configure the time-base submodule which is where the TBPRD and clock dividers are set. This is also the case for EPWM 5 and 10.

    I can do what you suggest and feed the synchout to the same as synchin -- should I do the same for all EPWMs that are not triggered by other PWMs?  Shouldn't I do

    Yes, you can feed through the sync signal in the way that you showed. For EPWM modules 6, 9, and 12 you do not need to configure the SYNCOUT pulse since those modules do not have a module after them in the sync scheme. For modules 4,5,7,8, and 10 you need to setup the SYNC OUT pulse:

    EPWM_setSyncOutPulseMode(EPWM4_BASE, EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO);
    
    EPWM_setSyncOutPulseMode(EPWM5_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN);
    
    EPWM_setSyncOutPulseMode(EPWM7_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN);
    EPWM_setSyncOutPulseMode(EPWM8_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN);
    
    EPWM_setSyncOutPulseMode(EPWM10_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN);

    Best Regards,

    Marlyn