Figure 24-2. QEI Input Signal Logic
Quadrature
Encoder
PhAn
PhBn
QEICTL.SWAP
0
1
0
1
PhA
PhB
QEICTL.INVA
QEICTL.INVB
QEICTL.SWAP
clk
dir
24.2
Signal Description
The following table lists the external signals of the QEI module and describes the function of each.
The QEI signals are alternate functions for some GPIO signals and default to be GPIO signals at
reset. The column in the table below titled "Pin Mux/Pin Assignment" lists the possible GPIO pin
placements for these QEI signals. The
AFSEL
bit in the
GPIO Alternate Function Select
(GPIOAFSEL)
register (page 770) should be set to choose the QEI function. The number in
parentheses is the encoding that must be programmed into the
PMCn
field in the
GPIO Port Control
(GPIOPCTL)
register (page 787) to assign the QEI signal to the specified GPIO port pin. For more
information on configuring GPIOs, see “General-Purpose Input/Outputs (GPIOs)” on page 742.
Table 24-1. QEI Signals (128TQFP)
Description
Buffer Type
Pin Type
Pin Mux / Pin
Assignment
Pin Number
Pin Name
QEI module 0 index.
TTL
I
PL3 (6)
84
IDX0
QEI module 0 phase A.
TTL
I
PL1 (6)
82
PhA0
QEI module 0 phase B.
TTL
I
PL2 (6)
83
PhB0
24.3
Functional Description
The QEI module interprets the two-bit gray code produced by a quadrature encoder wheel to integrate
position over time and determine direction of rotation. In addition, it can capture a running estimate
of the velocity of the encoder wheel.
The position integrator and velocity capture can be independently enabled, though the position
integrator must be enabled before the velocity capture can be enabled. The two phase signals,
PhAn
and
PhBn
, can be swapped before being interpreted by the QEI module to change the meaning
June 18, 2014
1750
Texas Instruments-Production Data
Quadrature Encoder Interface (QEI)