UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2015. All rights reserved.
User manual
Rev. 2.1 — 10 December 2015
1079 of 1441
NXP Semiconductors
UM10503
Chapter 34: LPC43xx/LPC43Sxx Quadrature Encoder Interface (QEI)
shows how quadrature encoder signals equate to direction and count.
34.7.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 (0xFFFF FFFF). In order for
a transition to be accepted, the input signal must remain in new state for the programmed
number of sample clocks.
34.7.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 three conditions. Incrementing past
the maximum position value (MAXPOS) will reset the position counter to zero. If the reset
on index bit (RESPI) is set, sensing the index pulse for the first time will once reset the
position counter to zero after the next positional increase (calibrate). If the continuously
reset on index bit (CRESPI) is set, sensing the index pulse will continuously reset the
position counter to zero after the next positional increase (recalibrate).
34.7.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 (TIME) reaches zero, the contents of the
velocity counter (VEL) are transferred to the capture (CAP) register. The velocity counter
Table 857. Encoder direction
DIR bit
DIRINV bit
direction
0
0
forward
1
0
reverse
0
1
reverse
1
1
forward
Fig 119. Quadrature Encoder Basic Operation
PhA
PhB
direction
position
-1 -1 -1 -1
-1
-1
-1 -1 -1
-1
-1
-1 -1 -1
-1
-1 -1 -1 -1
-1
-1
-1 -1 -1
+1 +1 +1 +1 +1 +1 +1 +1