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: Regarding CPU clocking while using 2 MCU

Part Number: TMS320F28379D

I am using two MCU in my project but I want to make the same clock to both MCU. 

Please give me a suggestion, how it would be possible. Because I have to synchronize the PWM of both controller.

What is the possibility to make synchronize more than one CPU? 

Ashutosh Bhatt

  • Ashutosh,

    Take a look at the clocking in the TMS320F28379D.

    As you can see CPU1 and CPU2 have the same source for clocking. The clock speeds and config is done on CPU1. Peripherals can be assigned to either CPU, then you can gate the clock to turn the peripheral on or off.

    Check out our dual core example for ADC EPWM.

    Looking at the code here you can figure out how the clocking is done.

    Nima Eskandari

  • Just to clarify, I may have misunderstood your question. The answer above is for two CPUs on one MCU. If you are asking whether you can run two different MCUs and synchronize their clocks, that is not supported by us and you have to take care of it in the software. The two MCUs will have the same freq but they will not be synchronized when it comes to their clocks. PLL and other modules are going to affect this.
  • Sir, 

    I am using one core of the first MCU and next one core of the second MCU. So firstly can I use single external crystal or clock source for BOTH MCU? 

    Second, the main difficulty I am facing that while using the first MCU I have two PWM with 90-degree phase shift and the second MCU PWM again I have to make the phase shift with respect of first MCU PWMs. Now I have 4 PWM (2 from Each MCU ) having the phase shift of 0 - 90- 180 - 270 degree respectively. 

    How can I do this possible? There is a limitation to use two MCU from the customer. The project is very high power front-end converter. 

    Expecting a solution from TI. 

    Thank You

    Ashutosh Bhatt

  • Sir,

    I am using one core of the first MCU and next one core of the second MCU. So firstly can I use single external crystal or clock source for BOTH MCU?

    Second, the main difficulty I am facing that while using the first MCU I have two PWM with 90-degree phase shift and the second MCU PWM again I have to make the phase shift with respect of first MCU PWMs. Now I have 4 PWM (2 from Each MCU ) having the phase shift of 0 - 90- 180 - 270 degree respectively.

    How can I do this possible? There is a limitation to use two MCU from the customer. The project is very high power front-end converter.

    Expecting a solution from TI.

    Thank You

    Ashutosh Bhatt

  • 1. You can use the same external clock and use that to source X1 on both MCUs. The clocks will be synced, but there will be skew internally. We don't recommend this.

    Also no, you cannot use the same crystal for two MCUs. Each MCU needs its own crystal.

    2. You can run both CPUs at the same frequency and use external pins for EXTSYNCOUT and EXTSYNCIN of PWMs on each device to issue sync commands to the counter of the PWMs. They will not be EXACTLY synced because their clocks will not be synced but you will get very close. These signals will go through the INPUT XBAR and OUTPUT XBAR which must be configured.

    Nima Eskandari

  • Thank You,

    I am going to try the second solution. This one seems may resolve my issue.

    Ashutosh Bhatt

  • I have done the same as you maintained in the second solution. I got the good result. But when I powered up the system and start the PWM, the PWM went very wrong. In both side I have two bridge wave converter and I need to sync all four converter to make dc link. and when I disable the phase-shift option from PWM1 of CPU1MCU2 it runs well.

    Please guide me to identify the issue , is there a problem of configuration or the problem of noise.

    I have directly connect the PWM4A pin to other MCU of PWM4A(configured as GPIO and then X-Bar input for SyncIN). The wire is around 2 meter long and the switching frequenct is 250Hz.

    I am also not able to understand of the lock mechnizem of X bar. In CPU1MCU1 I have configured X - Bar as out put by writing

    XBAR_enableOutputMux(XBAR_OUTPUT1,XBZR_MUX14);
    XBAR_setOutputLatchMode(XBAR_OUTPUT1,true);
    XBAR_setOutputMuxConfig(XBAR_OUTPUT1,XBAR_OUT_MUX14_EXTSYNCOUT);

    In CPU1MCU2 I have configured X - Bar as in put by writing

    XBAR_setInputPin(XBZR_INPUT5,SYNC_IN);

    But I am not getting the lock input and lock output in it.

    Please correct me if I am going wrong.

    Ashutosh Bhatt
  • What do you mean you got the good result? and when you powered it, it didnt work?

    Are you saying in debug mode everything worked but when you ran from FLASH and power cycled the devices it didnt?
  • For Output XBAR, You are mostly correct,
    1. You need to first disable the Output Muxes.
    2. Set the output mux config. What you are doing is correct. Select EXTSYNCOUT.
    3. Set the output latch mode. You most likely wont need a latch, so you can set it to false.
    4. Enable the output mux.

    You also need to configure the GPIO to select OUTPUTXBARx as the source for the GPIO. I would also configure the rest of the GPIO configs to match an output.

    For Input XBAR, you will do very similar things.
    Configure the GPIO to input. select a GPIO for INPUTXBAR5 or INPUTXBAR6. This will be EXTSYNCIN1 or 2 depending on which INPUTXBAR you selected.
    configuring INPUTXBAR will be,
    Selecting the GPIO for Input XBAR, then use INPUTXBAR5 or 6.
    You most likely don't need to use the log register.


    Now the locking,
    You use the locking to make sure you can only configure everything once. You may or may not use it. As far as how the signals are treated, it doesn't change anything. Most users will setup the XBARs and then lock everything at the end, since they do not configure the XBARs dynamically.