English
Language : 

LM3S618 Datasheet, PDF (498/572 Pages) List of Unclassifed Manufacturers – Microcontroller
Quadrature Encoder Interface (QEI)
Figure 15-1. QEI Block Diagram
PhA
PhB
IDX
Control & Status
QEICTL
QEISTAT
Velocity
Predivider
clk
Quadrature
Encoder dir
QEILOAD
Velocity Timer
QEITIME
Velocity Accumulator
QEICOUNT
QEISPEED
QEIMAXPOS
Position Integrator
QEIPOS
QEIINTEN
Interrupt Control
QEIRIS
QEIISC
Interrupt
15.2
Signal Description
Table 15-1 on page 498 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 Assignment" lists the possible GPIO pin placements
for these QEI signals. The AFSEL bit in the GPIO Alternate Function Select (GPIOAFSEL) register
(page 249) should be set to choose the QEI function. For more information on configuring GPIOs,
see “General-Purpose Input/Outputs (GPIOs)” on page 230.
Table 15-1. QEI Signals (48QFP)
Pin Name
Pin Number Pin Type Buffer Typea Description
IDX
33
I
TTL
QEI index.
PhA
14
I
TTL
QEI phase A.
PhB
12
I
TTL
QEI phase B.
a. The TTL designation indicates the pin has TTL-compatible voltage levels.
15.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, PhA
and PhB, can be swapped before being interpreted by the QEI module to change the meaning of
forward and backward, and to correct for miswiring of the system. Alternatively, the phase signals
can be interpreted as a clock and direction signal as output by some encoders.
498
July 14, 2014
Texas Instruments-Production Data