Quadrature Decoder Unit (QDU)
www.ti.com
398
SPRUI07–March 2020
Submit Documentation Feedback
Copyright © 2020, Texas Instruments Incorporated
Enhanced Quadrature Encoder Pulse (eQEP)
6.4.1.3 Up-Count Mode
The counter direction signal is hard-wired for up-count and the position counter is used to measure the
frequency of the QEPA input. Clearing the QDECCTL[XCR] bit enables clock generation to the position
counter on both edges of the QEPA input, thereby increasing the measurement resolution by a factor of
2x. In up-count mode, it is recommended that the application not configure QEPB as a GPIO mux option,
or ensure that a signal edge is not generated on the QEPB input.
6.4.1.4 Down-Count Mode
The counter direction signal is hardwired for a down-count and the position counter is used to measure the
frequency of the QEPA input. Clearing the QDECCTL[XCR] bit enables clock generation to the position
counter on both edges of a QEPA input, thereby increasing the measurement resolution by a factor of 2x.
In down-count mode, it is recommended that the application not configure QEPB as a GPIO mux option,
or ensure that a signal edge is not generated on the QEPB input.
6.4.2 eQEP Input Polarity Selection
Each eQEP input can be inverted using QDECCTL[8:5] control bits. As an example, setting the
QDECCTL[QIP] bit will invert the index input.
6.4.3 Position-Compare Sync Output
The enhanced eQEP peripheral includes a position-compare unit that is used to generate the position-
compare sync signal on compare match between the position-counter register (QPOSCNT) and the
position- compare register (QPOSCMP). This sync signal can be output using an index pin or strobe pin of
the EQEP peripheral.
Setting the QDECCTL[SOEN] bit enables the position-compare sync output and the QDECCTL[SPSEL] bit
selects either an eQEP index pin or an eQEP strobe pin.
6.5 Position Counter and Control Unit (PCCU)
The position-counter and control unit provides two configuration registers (QEPCTL and QPOSCTL) for
setting up position-counter operational modes, position-counter initialization/latch modes and position-
compare logic for sync signal generation.
6.5.1 Position Counter Operating Modes
Position-counter data may be captured in different manners. In some systems, the position counter is
accumulated continuously for multiple revolutions and the position-counter value provides the position
information with respect to the known reference. An example of this is the quadrature encoder mounted on
the motor controlling the print head in the printer. Here the position counter is reset by moving the print
head to the home position and then the position counter provides absolute position information with
respect to home position.
In other systems, the position counter is reset on every revolution using index pulse, and the position
counter provides a rotor angle with respect to the index pulse position.
The position counter can be configured to operate in following four modes
• Position-Counter Reset on Index Event
• Position-Counter Reset on Maximum Position
• Position-Counter Reset on the first Index Event
• Position-Counter Reset on Unit Time Out Event (Frequency Measurement)
In all the above operating modes, the position counter is reset to 0 on overflow and to the QPOSMAX
register value on underflow. Overflow occurs when the position counter counts up after the QPOSMAX
value. Underflow occurs when the position counter counts down after "0". The Interrupt flag is set to
indicate overflow/underflow in QFLG register.