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.

EPWM syncronization between two hercules microcontrollers.

Other Parts Discussed in Thread: TMS570LS1225

Hi,

I'm working on the syncronization of the EPWM modules of two hercules TMS570LS1225 microcontrolers. One microcontroller works as master generating the syncronization signal and the other as slave receving the signal of the master. The master already generates the syncronization signal that is put in the SYNC_OUT pin. The Slave receives the signal though the SYNC_IN pin but it doesn't  syncronize. I guest the epwm module of the slave uses the signal because when I disconnect the syncronization wire the variation of the phase is ramdom in speed and direction but when the syncronization wire is connected the variation of the phase between epwm1-master and epwm1-slave is constant and always in the same direction.

All the ePWM modules in both microcontrollers have updown counter and compared with cmpA to create a pulse centered in the top of the counter ramp.

The setup of the timebase and clocks is the same in both microcontrollers and epwm modules.

The setups related to the sincronization of the slave ePWM1 module are:

In pinmux.c:

1) device input for ePWM1

PINMMR36[25] = 0, the SYNCI input to the ePWM1 comes from the ePWM1_SYNCI device input
terminal. This is the default connection.

-    PINMUX_ETPWM_TIME_BASE_SYNC_ENABLE(ON);

2) ePWM1_SYNCI has three options, I have try all of them:

-Async -> PINMMR47[8] = 1

-Sync -> PINMMR47[8] = 0 and PINMMR47[9] = 1

-Sync  ans Filtered -> PINMMR47[9:8] = 00 and PINMMR47[10] = 1


    PINMUX_ETPWM_EPWM1SYNCI_ENABLE(SYNC); //PINMMR47[8] = 0 and PINMMR47[9] = 1

 

In epwm1 initialization:

3) PHSEN bit of TBCTL to 1. // to enable phase load and external Sync.

Anybody see something wrong? Any idea?

Thanks in advance.

Raúl

  • How much time are the two signals out of phase, and is the slave advanced or behind the phase of the master?
  • The master and slave PWM signals are square (50% dutty) and 100khz frecuency.
    In the scope I stop the Master PWM signal with the trigger then the Slave PWM signal moves to left. I think this means the slave is falling behind the phase. The out os phase is variable siince slave signal is moving. It takes around 1 second to cross the master cycle.

    Thanks for reply.

    Raúl