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.

F28335-QEP-测速

在进行eqep测位置时,qep的 position counter register中的计数要么是0要么是最大值QPOSMAX,不论电机的转速是多少,position counter register中的计数始终在0和设置的最大值QPOSMAX之间跳动,不知道为什么,请大家帮忙分析一下,谢谢。下面是我的eqep的初始化:


EQep1Regs.QDECCTL.bit.QSRC=00; // QEP quadrature count mode

EQep1Regs.QEPCTL.bit.FREE_SOFT=2;
EQep1Regs.QEPCTL.bit.PCRM=00; // PCRM=00 mode - QPOSCNT reset on index event
EQep1Regs.QEPCTL.bit.UTE=1; // Unit Timeout Enable
EQep1Regs.QEPCTL.bit.QCLM=1; // Latch on unit time out
EQep1Regs.QPOSMAX=0xffffffff;
EQep1Regs.QEPCTL.bit.QPEN=1; // QEP enable

EQep1Regs.QCAPCTL.bit.UPPS=5; // 1/32 for unit position
EQep1Regs.QCAPCTL.bit.CCPS=7; // 1/128 for CAP clock
EQep1Regs.QCAPCTL.bit.CEN=1; // QEP Capture Enable

 EQep1Regs.QEINT.bit.UTO = 1;