This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于28335EQEP模块状态寄存器QEPSTS复位的问题。



关于28335EQEP模块状态寄存器QEPSTS:UPEVNT复位的问题,手册中说将该位置1,便可复位。可是我的程序里面将QEPSTS:UPEVNT写入1后,并没有复位,一直显示为1,不知道是何缘故,还望指点,谢谢~

程序部分:

if(EQep2Regs.QEPSTS.bit.UPEVNT==1) 
{
      temp3=EQep2Regs.QCTMR;
      temp=EQep2Regs.QPOSCNT;
if(EQep2Regs.QEPSTS.bit.COEF==0) 
{
      temp1=(unsigned long)EQep2Regs.QCTMRLAT;
      temp2=(unsigned long)EQep2Regs.QCPRDLAT;
}
else 
      temp2=0xFFFF;

     EQep2Regs.QEPSTS.bit.UPEVNT=1;
     EQep2Regs.QEPSTS.bit.COEF=1;
}

EQEP设置:

void EQEPInit(void)
{
EQep2Regs.QUPRD=1500000; 
EQep2Regs.QDECCTL.bit.QSRC=00; 

EQep2Regs.QEPCTL.bit.FREE_SOFT=0;
EQep2Regs.QEPCTL.bit.PCRM=11; 
EQep2Regs.QEPCTL.bit.UTE=1; 
EQep2Regs.QEPCTL.bit.QCLM=0; 
EQep2Regs.QPOSMAX=0xffffffff;
EQep2Regs.QEPCTL.bit.QPEN=1; 

EQep2Regs.QCAPCTL.bit.UPPS=2; 
EQep2Regs.QCAPCTL.bit.CCPS=0;
EQep2Regs.QCAPCTL.bit.CEN=1; 
}