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.
Tool/software: Code Composer Studio
Hello,
I'm trying to understand how the ePWM synchronization works for the F28379D microcontroller. Unfortunately, the technical reference manual is rather vague and doesn't have much explanation to go along with Figure 15-7.
A few questions I have:
1. I know that if TBCTL[PHSEN] = 1, then when a synchronization event occurs, then (TBCTR) will be loaded with the phase (TBPHS). In examples that I've looked at, I've typically seen one "master" ePWM with TBCTL[PHSEN] = 0 and the other "slave" ePWMs TBCTL[PHSEN] = 1. Is it possible to have all ePWMs have TBCTL[PHSEN] = 1, or it necessary to have one "master" with TBCTL[PHSEN] = 0 ?
2. Can you synchronize ePWM3 and ePWM2 with ePWM1 even if all three ePWMs have different periods? If so, when is this synchronization done? For example, if TBPHS of ePWM2 is changed, when will this take effect?
3. If I understand correctly, by default the sync output of ePWM1 goes to the sync input of ePWM2, and the sync output of ePWM2 goes to the sync input of ePWM3. Is there a way to make the sync output of ePWM1 go to the sync input of ePWMx, bypassing the ones in between? If so, how is this done?
Thank you,
Kevin
Hi,
Kevin Bachovchin said:1. I know that if TBCTL[PHSEN] = 1, then when a synchronization event occurs, then (TBCTR) will be loaded with the phase (TBPHS). In examples that I've looked at, I've typically seen one "master" ePWM with TBCTL[PHSEN] = 0 and the other "slave" ePWMs TBCTL[PHSEN] = 1. Is it possible to have all ePWMs have TBCTL[PHSEN] = 1, or it necessary to have one "master" with TBCTL[PHSEN] = 0 ?
Kevin Bachovchin said:2. Can you synchronize ePWM3 and ePWM2 with ePWM1 even if all three ePWMs have different periods? If so, when is this synchronization done? For example, if TBPHS of ePWM2 is changed, when will this take effect?
Kevin Bachovchin said:3. If I understand correctly, by default the sync output of ePWM1 goes to the sync input of ePWM2, and the sync output of ePWM2 goes to the sync input of ePWM3. Is there a way to make the sync output of ePWM1 go to the sync input of ePWMx, bypassing the ones in between? If so, how is this done?
Thanks for your helpful reply. The only reason I would want to synchronize PWMs with a different period would just be because to "pass through" the synchronization, but I suppose that it is not a good way to do it.
For my application, I want to synchronize ePWM4 with ePWM1 (which both have the same period) and I want to synchronize ePWM3, ePWM5, and ePWM6 with ePWM2 (which all four have the same period, but a different period than ePWM1 and ePWM4). How would I set TBCTL[SYNCOSEL] to be able to accomplish this in a clean way?
I suppose the best way to do this is not to set TBCTL[SYNCOSEL] = 1 for ePWM1 and then TBCTL[SYNCOSEL] = 0 for ePWM2-6.
Hi,
please refer to Figure 15-7. Time-Base Counter Synchronization Scheme
of the device TRM.
There are certain restrictions sue to the structure of the Sync Chain as depicted in this diagram.
For ex, ePWM2 can not independently generate sync to ePWM5, and ePWM6.
Please follow the diagram and create Sync chains accordingly.
Could you elaborate on what you mean about the restrictions? I have been studying Figure 15-7, but as a new user it is very confusing to me. Are only ePWM1,4,7,10, etc able to be "masters"? Those are the only ones in the figure that have "EPWMSYNCOUT". Also, the effect of TBCTL[SYNCOSEL] is not shown in the figure.
Are you saying that ePWM2 can be the "master" for ePWM3, just not for ePWM5 and 6?
Also, for my application where I want to synchronize ePWM1 and 4, and synchronize ePWM2, 3, 5, and 6, would setting TBCTL[SYNCOSEL] = 1 for ePWM1 and then TBCTL[SYNCOSEL] = 0 for ePWM2-6 to synchronize them all together work? Or would this create a problem?
Thanks,
Kevin
Hi Subrahmanya,
Could you elaborate on what you mean about the restrictions? I have been studying Figure 15-7, but as a new user it is very confusing to me. Are only ePWM1,4,7,10, etc able to be "masters"? Those are the only ones in the figure that have "EPWMSYNCOUT". Also, the effect of TBCTL[SYNCOSEL] is not shown in the figure.
Are you saying that ePWM2 can be the "master" for ePWM3, just not for ePWM5 and 6?
Also, for my application where I want to synchronize ePWM1 and 4, and synchronize ePWM2, 3, 5, and 6, would setting TBCTL[SYNCOSEL] = 1 for ePWM1 and then TBCTL[SYNCOSEL] = 0 for ePWM2-6 to synchronize them all together work? Or would this create a problem?
Thanks,
Kevin
Hi,
Kevin Bachovchin said:I have been studying Figure 15-7, but as a new user it is very confusing to me. Are only ePWM1,4,7,10, etc able to be "masters"?
Kevin Bachovchin said:Are you saying that ePWM2 can be the "master" for ePWM3, just not for ePWM5 and 6?
Kevin Bachovchin said:for my application where I want to synchronize ePWM1 and 4,
Kevin Bachovchin said:synchronize ePWM2, 3, 5, and 6, would setting TBCTL[SYNCOSEL] = 1 for ePWM1 and then TBCTL[SYNCOSEL] = 0 for ePWM2-6 to synchronize them all together work? Or would this create a problem?
Thanks, this was very helpful.
Just to clarify, could I accomplish what I want (synchronizing ePWM 2, 3, 5, and 6 together and synchronizing 1 and 4 together) by synchronizing all six together with EPWM1 as the master and EPWM2-6 as slaves? Would this still work even though 1 and 4 will have different switching frequencies than 2, 3, 5, and 6 ? (For my application, I need to be able to phase shift 1 and 4 relative to each other, and phase shift 2, 3, 5, and 6 relative to each other. The phase shift between 1/4 relative to 2/3/5/6 does not matter to me.)
Hi Subrahmanya,
Thanks for your helpful replies.
Just to clarify, could I accomplish what I want (synchronizing ePWM 2, 3, 5, and 6 together and synchronizing 1 and 4 together) by synchronizing all six together with EPWM1 as the master and EPWM2-6 as slaves? Would this still work even though 1 and 4 will have different switching frequencies than 2, 3, 5, and 6 ? (For my application, I need to be able to phase shift 1 and 4 relative to each other, and phase shift 2, 3, 5, and 6 relative to each other. The phase shift between 1/4 relative to 2/3/5/6 does not matter to me.)
Hi,
There is nothing that stops Synchronization from occurring just because your are operating PWMs at different frequencies.
If you are synchronizing PWMs operating at different frequencies - make sure that result is what you intended, as it could result in random waveform if the frequencies are not integral multples etc. So, i would say that there is no restriction from MCU to prevent synchronization for modules operating at different frequencies but as a user you need to be aware of the consequences and make sure the outputs are as intended by your application.