EPwm1Regs.TBPRD = 5000;
EPwm1Regs.TBPHS.half.TBPHS = 0;
EPwm1Regs.TBCTR = 0;
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;
EPwm1Regs.TBCTL.bit.CLKDIV = 0x7;
EPwm1Regs.TBCTL.bit.HSPCLKDIV = 0x7;
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;
EPwm1Regs.AQCTLA.bit.CAU = AQ_SET;
EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm1Regs.DBCTL.bit.IN_MODE = DB_DISABLE;
EPwm1Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE;
EPwm1Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC;
EPwm1Regs.DBFED = 1023;
EPwm1Regs.DBRED = 1023;
EPwm1Regs.CMPA.half.CMPA = 2000;
这同样的一段程序,对epwm1、4、5有用,对epwm2、3、6、没有用,暂停看对应寄存器,这几个模块的的寄存器都没有写成功,都是0x0000;
麻烦高手指点下
此帖出自
小平头技术问答
一周热门 更多>