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.

CCS/TMS320F28375D: EQEP QCTMRLUT About the maximum value

Part Number: TMS320F28375D

Tool/software: Code Composer Studio

The pulse count and QCTMRLUT are checked for each interrupt.
The settings are as follows:
================================================== ====
GpioCtrlRegs.GPAQSEL2.bit.GPIO20 = 2; // Synchronize GPIO20 to SYSCLK 6sample (EQEP1A)
GpioCtrlRegs.GPAQSEL2.bit.GPIO21 = 2; // Synchronize GPIO21 to SYSCLK 6sample (EQEP1B)
GpioCtrlRegs.GPAQSEL2.bit.GPIO23 = 2; // Synchronize GPIO23 with 6 samples of SYSCLK (EQEP1I)

EQep1Regs.QDECCTL.bit.QSRC = 00;     // Quadrature count mode
EQep1Regs.QEPCTL.bit.FREE_SOFT = 2;
EQep1Regs.QEPCTL.bit.PCRM = 01;

EQep1Regs.QEPCTL.bit.UTE = 0;             // not UTE
EQep1Regs.QEPCTL.bit.QCLM = 0;          // read QPOSCNT = TMRLAT
EQep1Regs.QCAPCTL.bit.UPPS = 0xF;    // Prevent generation of UPEVNT
EQep1Regs.QPOSMAX = 0x0000FFFF;    // Maximum position = 0xFFFF

EQep1Regs.QCAPCTL.bit.CCPS = 3;
EQep1Regs.QCAPCTL.bit.CEN = 1; // Enable QEP capture
EQep1Regs.QEPCTL.bit.QPEN = 1; // QEP enabled
================================================== ====

After confirming the operation with this setting,
The value of QPOSCNT will increment correctly, but the value of QCTMRLUT may be skipped.
Increasing the number of pulses increases the likelihood of occurrence.

Please tell me how to read the value of QCTMRLUT correctly.

  • Hi,

    You cannot configure EQep1Regs.QCAPCTL.bit.UPPS = 0xF;    // Prevent generation of UPEVNT; this is invalid configuration and is marked reserved. Also, by setting it to 0xF it does not prevent generation of UPEVNT. 

    Based on the logs it looks like UPEVNT is generated every 4096 QCLK cycles, which is resetting QCTMR. Hence you are getting invalid counts (highlighted in red).

    What is the intent of using QCTMR? If you just intent to use it as a timer, you can use CPU timers or Unit time (inside eQEP).

    Regards,

    Nirav

  • Hi Nirav.

    Thank you for your reply.
    I understand that UPEVENT is generated and reset.

    Use QCTMR to determine the PWM for each interrupt.
    If the number of pulses is far apart, calculate the compensation process.
    QCTMRLUT considers it to be the most accurate time from the last acquisition of QPOSCNT to the acquisition of this QPOSCNT.

    Is there a way to suppress UPEVENT?

  • Hi,

    Sorry for the Delayed response. To answer your question - By design, UPEVENT cannot be suppressed.

    An alternative solution to that will be:

    - Configure EQep1Regs.QCAPCTL.bit.UPPS = 0xB; which is the max value. This will generate UPEVENT every 2048 QCLK cycles and reset QCTMR.

    - Now knowing the ratio between TMR+- & CNT+- and by accumulating QPOSCNT value you can estimate, at what QCTMR count will the next UPEVENT occur (As you know that it will occur after every 2048 QCLK cycles). 

    No sure if this solution is acceptable in your system, but based on the eQEP design there is no way to suppress UPEVENT.

    Regards,

    Nirav

  • Hi,

    Can you also clarify the actual used case?

    Can you use eCAP to capture the time between the events?

    Regards,

    Nirav