DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10316_0
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 00.06 — 17 December 2008
462 of 571
NXP Semiconductors
UM10316
Chapter 27: LPC29xx Quadrature Encoder Interface (QEI)
4.1.2 Digital input filtering
All three encoder inputs (PhA, PhB, and index) require digital filtering. The number of
sample clocks is user programmable from 1 to 4,294,967,295. In order for a transition to
be accepted, the input signal must remain in new state for the programmed number of
sample clocks.
4.2 Position capture
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.
The position integrator and velocity capture can be independently enabled. Alternatively,
the phase signals can be interpreted as a clock and direction signal as output by some
encoders.
The position counter is automatically reset on one of two conditions. Incrementing past
the maximum position value (QEIMAXPOS) will reset the position counter to zero. If the
reset on index bit (
RESPI
) is set, sensing the index pulse will reset the position counter to
zero.
4.3 Velocity capture
The velocity capture has a programmable timer and a capture register. It counts the
number of phase edges (using the same configuration as for the position integrator) in a
given time period. When the velocity timer (QEITIME) overflows the contents of the
velocity counter (QEIVEL) are transfered to the capture (QEICAP) register. The velocity
counter is then cleared. The velocity timer is loaded with the contents of the velocity
reload register (QEILOAD). Finally, the velocity interrupt (TIM_Int) is asserted. The
number of edges counted in a given time period is directly proportional to the velocity of
the encoder. Setting the reset velocity bit (RESV) has the same effect as an overflow of
the velocity timer, except that the setting the RESV bit will not generate a velocity
interrupt.
shows how the quadrature encoder converts the phase input signals into
clock pulses, the direction signal, and the encoder clock (in 4x mode).
Table 384. Encoder direction
DIR bit
DIRINV bit
direction
0
0
forward
1
0
reverse
0
1
reverse
1
1
forward