器件:TMS320F28335
模块:QEP
设置:
EQep1Regs.QUPRD = UNIT_TIME_REG; // Unit Timer for 5kHz at 150 MHz SYSCLKOUT
EQep1Regs.QUTMR = 0;
EQep1Regs.QDECCTL.bit.QSRC = 1; // Direction-count Mode
EQep1Regs.QEPCTL.bit.FREE_SOFT = 2;
EQep1Regs.QEPCTL.bit.PCRM = POS_RST_MAX; // PCRM=00 mode - QPOSCNT reset on index event
// index event
EQep1Regs.QEPCTL.bit.UTE = 1; // Unit Timeout Enable
EQep1Regs.QEPCTL.bit.QCLM = 1; // Latch on unit time out
EQep1Regs.QPOSMAX = MAX_POS_CUNT;
EQep1Regs.QEPCTL.bit.QPEN = 1; // QEP enable
EQep1Regs.QCAPCTL.bit.UPPS = 2; // 1/4 for unit position
EQep1Regs.QCAPCTL.bit.CCPS = 7; // 1/128 for CAP clock, 1.171875MHz
EQep1Regs.QCAPCTL.bit.CEN = 1; // QEP Capture Enable
EQep1Regs.QEINT.bit.UTO = 1;
问题:
运行时,使用UTO事件,在中断内处理低速计算。然而,处理UPEVNT事件时,QEPSTS为0x8C写入0x80时也没办法清除COEF、 CDEF位,
以上问题,请帮助解决。谢谢大家。