Hi,
i am using the EQep modul of the TMS320F28335 on the F28335 PGF ControlCard (with the DRV8312EVM Evaluation board) for speed measurement. The Problem is, that the QPOSCNT register doesn't increment or decrement. I think the hardware is working fine, because i can see that the both GPIO pins (20 and 21) are correctly changing their values. Also the registers are correctly initialized. I tried the Example_2833xEqep_pos_speed project and it worked (QPOSCNT incremented and decremented) with the same register initialization as in my project. Also the sequence of initialization is the same as in the example project.
Here is the init code:
// Enable clock to eQEP module
SysCtrlRegs.PCLKCR1.bit.EQEP1ENCLK = 1;
#if (CPU_FRQ_150MHZ)
// Unit Timer at 150 MHz SYSCLKOUT
EQep1Regs.QUPRD = 150000000 / 100; // 100 Hz
#endif
// eQEP Decoder Control Register
EQep1Regs.QDECCTL.bit.QSRC = 00; // QEP quadrature count mode
EQep1Regs.QDECCTL.bit.SOEN = 0; // Disable position-compare sync output
EQep1Regs.QDECCTL.bit.XCR = 0; // Count the rising/falling edge
EQep1Regs.QDECCTL.bit.SWAP = 0; // Quadrature-clock inputs aren't swapped
EQep1Regs.QDECCTL.bit.QAP = 0; // QEPA input polarity: no effect
EQep1Regs.QDECCTL.bit.QBP = 0; // QEPB input polarity: no effect
// eQEP Init Position Count Register
EQep1Regs.QPOSINIT = 0;
// eQEP Maximum Position Count Register
EQep1Regs.QPOSMAX = 0xffffffff;
// eQEP Control Register
EQep1Regs.QEPCTL.bit.FREE_SOFT = 2; // eQEP is unaffected by emulation suspend
EQep1Regs.QEPCTL.bit.PCRM = 00; // QPOSCNT reset on index event
EQep1Regs.QEPCTL.bit.UTE = 1; // Unit Timer Enable
EQep1Regs.QEPCTL.bit.QCLM = 1; // Latch on unit time out
EQep1Regs.QEPCTL.bit.SWI = 0; // Reset SWI-Bit
EQep1Regs.QEPCTL.bit.QPEN = 1; // eQEP position counter is enabled
// eQEP Capture Control Register
EQep1Regs.QCAPCTL.bit.UPPS = 5; // Unit position event prescaler: QCLK/32
EQep1Regs.QCAPCTL.bit.CCPS = 7; // Capture timer clock prescaler: SYSCLKOUT/128
EQep1Regs.QCAPCTL.bit.CEN = 1; // QEP Capture Enable
//EQep1Regs.QCLR.all = 0xFFFF;
What's the mistake? Can anybody tell me what i can do to solve this problem?