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.
Tool/software: Code Composer Studio
If a direction change occurs between the unit position events, then
an error flag is set in the status register (QEPSTS[CDEF]).
But it doesn't change
Hi Victor,
Can you provide a snippet of your code for how you're testing this? Initialization and other relevant QEP code.
How are you testing for the case where CDEF goes high? Has the QEPSTS.UPEVENT flag been set prior to a direction change occurring?
I believe a direction change would have to happen between the UPEVNT pulses to trigger CDEF, like shown below:
Best,
Kevin
EQEP MODULE CONFIGURATION:
I think there is something wrong with EQEP
EQep1Regs.QDECCTL.bit.QSRC = 0; // QEP quadrature count mode
EQep1Regs.QDECCTL.bit.QAP = encABSwap; // 1;
EQep1Regs.QEPCTL.bit.PCRM = 0; // PCRM = 0 mode - QPOSCNT reset on index event
EQep1Regs.QEPCTL.bit.QCLM = 0; // 0:Latch on position counter read by CPU. 1: Latch on unit time out
EQep1Regs.QEPCTL.bit.IEL = 3; // Latches position counter on rising edge of the index signal
EQep1Regs.QPOSMAX = encResolution-1;
EQep1Regs.QEPCTL.bit.QPEN = 1; // QEP enable
EQep1Regs.QCAPCTL.bit.UPPS = 0; // 1/1 for unit position
EQep1Regs.QCAPCTL.bit.CCPS = 0; // 1/2 for CAP clock
EQep1Regs.QCAPCTL.bit.CEN = 1; // QEP Capture Enable
Attached is data,Pls review.data.xlsx
Victor,
I'm misunderstanding your question. Are you still wondering why QEPSTS[CDEF] is not getting set high?
It doesn't seem like the register bit would be set based on what you've provided, i.e. doesn't seem like a direction change occurred in-between UPEVNTs. Am I missing something?
Best,
Kevin
Hi Victor,
Have you been able to resolve this issue on your own? Do you need any additional support?
Best,
Kevin