Hello All,
I am trying to use all epwm modules (from epwm1 to epwm6) as synchronous. When I programmed the epwm modules according to the reference guide, there are 2 clock cycles difference between the master and slave module counters.
If I disable the synchoronization (EPwm2Regs.TBCTL.bit.PHSEN = TB_DISABLE) there is no difference. What is wrong with this? In the following my code can be seen,
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetrical mode
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Master module
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; // Sync down-stream module
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN;
EPwm2Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN;
EPwm2Regs.TBCTL.bit.PHSEN = TB_ENABLE;