Part Number: TMS320F28034
Dear team:
Enable synchronization of epwm1 and epwm2. Enable the shadow register of TB.
The TBPRD shadow register is enabled when TBCTL[PRDLD] = 0. Reads from and writes to the TBPRD memory address go to the shadow register. The shadow register contents are transferred to the active register (TBPRD (Active) ← TBPRD (shadow)) when the time-base counter equals zero (TBCTR = 0x0000). By default the TBPRD shadow register is enabled. EPwm1Regs.TBCTL.bit.FREE_SOFT=TB_FREEZE; EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW; EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; EPwm2Regs.TBCTL.bit.PHSEN = TB_ENABLE; EPwm2Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; EPwm2Regs.TBCTL.bit.PRDLD = TB_SHADOW; EPwm2Regs.TBPHS.half.TBPHS = 3; EPwm2Regs.TBCTR = 0;
During the program running, I need to dynamically modify the frequency (TBPRD) of epwm1 and epmw2, and the two frequencies are the same.
In this configuration, is it possible that TBCTR of epwm2 can not count to 0 because TBPHS is loaded by TBCTR of epwm2?
Best regards