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: Synchronizing EPWM and Timer 0

Part Number: TMS320F28375D
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG

Hi

I am using TMS320F28375D for an application. I'm generating the ADC SOCs by using timer 0 in CPU1. My PWM signals are generated by CPU2. Can I synchronize timer 0 in CPU1 and ePWM in CPU2 in any way?

  • Hi Murali,

    The short answer is, you can't necessarily directly sync the two, but I'd like to first clarify what methodology of syncing you are trying to implement: are you trying to start the CPUTimer and ePWM around same time? Or do you mean to issue a sync pulse of some sort during run time?). Perhaps you could look into an IPC handshake between CPU1 and CPU2 to do so using IPC_sync();?

    Best Regards,

    Allison 

  • Hi Allison,

    I am trying to start the CPU timer and ePWM around the same time. Can this be achieved by using IPC_sync()? My requirement is, for example to take 10 current samples in one switching cycle. And I am also planning to use CPU1 strictly for ADC operations and maybe filtering. CPU2 do the control and PWM generation part.

    Best regards,

    Murali

  • Hi Murali,

    Yes, the IPC_sync() function can be used to start the CPU timer and ePWM around the same time. 

    As an alternative to your current set up, could you instead generate your ADC SOCs using an ePWM module on CPU1? You might have noticed in some of the single-CPU epwm examples that the "TBCLKSYNC" bit is used to start the timers of multiple ePWMs at exactly the same time. There is also a bit "GTBCLKSYNC" that can be used to start the timers of multiple ePWMs across multiple CPUs. 

    For the ePWM modules to start at the same time across the different cores you would need to use this "GTBCLKSYNC" (Global Time Base Clock Sync) bit. There is a description of a similar case to this in another past E2E if you'd like to take a look: e2e.ti.com/.../3780146

    Best Regards,

    Allison

  • Hi Allison,

    I have looked into it. But I need to take a few samples, say 10, in one switching cycle. IF my understanding is correct, I cannot get that many samples using a single ePWM module for SOC generation. I also cannot use several ePWM modules sampling on the same channel to get an over sampled signal. Is there any example that uses IPC_sync() function that I can look into? I did not find any in C2000Ware.

    Thank you

    Murali

  • Hi Murali, 

    You are correct, EPWM would not be able to support enough samples in one switching cycle as you require. 

    There is one example for F2837xD that utilizes IPC_sync() - this is the ipc_ex2_gpio_sysconfig example located at {C2000Ware}\driverlib\f2837xd\examples\dual\ipc.You can use the IPC_sync function to synchronize both the cores. This function will be returned only if the other core has also reached the IPC_sync function. Here is an example where CPU1 and CPU2 use Flag 31 for synchronizing:

    On CPU1 side:  IPC_sync(IPC_CPU1_L_CPU2_R, IPC_FLAG31);

    On CPU2 side:    IPC_sync(IPC_CPU2_L_CPU1_R, IPC_FLAG31);

    After using IPC_sync, you should be able start the CPUTimer on one CPU and start the ePWM on the other CPU so they begin around the same time right after the CPUs sync up.

    Best Regards,

    Allison