English
Language : 

LM3S5749 Datasheet, PDF (839/947 Pages) Texas Instruments – Stellaris® LM3S5749 Microcontroller
Stellaris® LM3S5749 Microcontroller
Figure 20-1. QEI Block Diagram
Control & Status
QEICTL
QEISTAT
QEILOAD
Velocity Timer
QEITIME
PhA
PhB
IDX
Velocity
Predivider
clk
Quadrature
Encoder dir
Velocity Accumulator
QEICOUNT
QEISPEED
QEIMAXPOS
Position Integrator
QEIPOS
QEIINTEN
Interrupt Control
QEIRIS
QEIISC
Interrupt
20.2
Signal Description
Table 20-1 on page 839 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 386) should be set to choose the QEI function. For more information on configuring GPIOs,
see “General-Purpose Input/Outputs (GPIOs)” on page 363.
Table 20-1. QEI Signals (100LQFP)
Pin Name
Pin Number Pin Type Buffer Typea Description
IDX0
40
I
TTL
QEI module 0 index.
PhA0
43
I
TTL
QEI module 0 phase A.
PhB0
42
I
TTL
QEI module 0 phase B.
a. The TTL designation indicates the pin has TTL-compatible voltage levels.
20.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.
November 17, 2011
839
Texas Instruments-Production Data