EPwm6Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm6Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm6Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm6Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;
EPwm6Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO;
管子都是这么配置的,应该是在三角波过零点时更新周期寄存器和比较寄存器,为什么当周期变化时更新会出现驱动消失。
EALLOW;
for (uiCnt = 0; uiCnt < 6; uiCnt++)
{
EPwmRegs = (struct EPWM_REGS * )((INT32U)(&EPwm1Regs)+(64*uiCnt));
EPwmRegs->TBPRD = uiPeriod[uiCnt];
EPwmRegs->TBPRDHR = uiPerdHR[uiCnt];
EPwmRegs->TBPHS.half.TBPHS = uiTblPhs[uiCnt];
EPwmRegs->CMPA.half.CMPA = uiCompAR[uiCnt];
EPwmRegs->CMPB = uiCompBR[uiCnt];
EPwmRegs->DBFED = g_uiDzone;
EPwmRegs->DBRED = g_uiDzone;
}
EDIS;
以上时改变周期
Nancy Wang:
请去c2000论坛咨询。
e2echina.ti.com/…/