English
Language : 

LM3S2965 Datasheet, PDF (490/542 Pages) List of Unclassifed Manufacturers – Microcontroller
Quadrature Encoder Interface (QEI)
19.2
Figure 19-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
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.
The QEI module supports two modes of signal operation: quadrature phase mode and clock/direction
mode. In quadrature phase mode, the encoder produces two clocks that are 90 degrees out of
phase; the edge relationship is used to determine the direction of rotation. In clock/direction mode,
the encoder produces a clock signal to indicate steps and a direction signal to indicate the direction
of rotation. This mode is determined by the SigMode bit of the QEI Control (QEICTL) register (see
page 494).
When the QEI module is set to use the quadrature phase mode (SigMode bit equals zero), the
capture mode for the position integrator can be set to update the position counter on every edge of
the PhA signal or to update on every edge of both PhA and PhB. Updating the position counter on
every PhA and PhB provides more positional resolution at the cost of less range in the positional
counter.
When edges on PhA lead edges on PhB , the position counter is incremented. When edges on PhB
lead edges on PhA , the position counter is decremented. When a rising and falling edge pair is
seen on one of the phases without any edges on the other, the direction of rotation has changed.
490
June 04, 2007
Preliminary