Hi, I'm trying to use SWFSYNC (Software Forced Synchronization Pulse) to do synchronization between ePWM1, ePWM2, ePWM3.
In the datasheet it says that
SWFSYNC is valid (operates) only when EPWMxSYNCI is selected by SYNCOSEL = 00.
1. If I use "EPwm2Regs.TBCTL.bit.SWFSYNC=1;" to force EPwm2Regs.TBCTR=EPwm2Regs.TBPHS.half.TBPHS, I will have to configure SYNCOSEL of ePWM1 or ePWM2 to be 00? It makes no sense to configure EPwm2Regs.TBCTL.bit.SYNCOSEL to be 00 because the sync source of epwm2 is determined by epwm1.
2. Moreover, it seems that no matter what SYNCOSEL is configured for ePWM1 and ePWM2, the SWFSYNC can always force EPwm2Regs.TBCTR=EPwm2Regs.TBPHS.half.TBPHS.
__asm(" NOP"); //EPwm1Regs.TBCTR and EPwm2Regs.TBCTR are both 0x20;
EPwm2Regs.TBCTL.bit.SWFSYNC=1;
__asm(" NOP");
__asm(" NOP");
__asm(" NOP");
__asm(" NOP");
__asm(" NOP");
__asm(" NOP");
__asm(" NOP");
__asm(" NOP"); //EPwm1Regs.TBCTR=0x53, EPwm2Regs.TBCTR=0x02, which means that EPwm2Regs.TBCTL.bit.SWFSYNC takes effect
3. I add __asm(" NOP"); because if I single step through EPwm2Regs.TBCTL.bit.SWFSYNC=1; EPwm1Regs.TBCTR and EPwm2Regs.TBCTR are the same, means that EPwm2Regs.TBCTL.bit.SWFSYNC does not take effect, why?