
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
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
516 of 808
1.
Basic configuration
The QEI is configured using the following registers:
1. Power: In the PCONP register (
), set bit PCQEI.
Remark:
On reset, the QEI is disabled (PCQEI = 0).
2. Peripheral clock: In the PCLKSEL0 register (
), select PCLK_QEI.
3. Pins: Select QEI pins through the PINSEL registers. Select pin modes for port pins
with QEI functions through the PINMODE registers (
4. Interrupts: See
. The QEI interrupt is enabled in the NVIC using the
appropriate Interrupt Set Enable register.
2.
Features
This Quadrature Encoder Interface (QEI) has the following features:
•
tracks encoder position.
•
increments/ decrements depending on direction.
•
programmable for 2X or 4X position counting.
•
velocity capture using built-in timer.
•
velocity compare function with less than interrupt.
•
uses 32-bit registers for position and velocity.
•
three position compare registers with interrupts.
•
index counter for revolution counting.
•
index compare register with interrupts.
•
can combine index and position interrupts to produce an interrupt for whole and partial
revolution displacement.
•
digital filter with programmable delays for encoder input signals.
•
can accept decoded signal inputs (clock and direction).
•
connected to APB.
3.
Introduction
A quadrature encoder, also known as a 2-channel incremental encoder, converts angular
displacement into two pulse signals. By monitoring both the number of pulses and the
relative phase of the two signals, you can track the position, direction of rotation, and
velocity. In addition, a third channel, or index signal, can be used to reset the position
counter. This quadrature encoder interface module decodes the digital pulses from a
quadrature encoder wheel to integrate position over time and determine direction of
rotation. In addition, it can capture the velocity of the encoder wheel.
UM10360
Chapter 26: LPC17xx Quadrature Encoder Interface (QEI)
Rev. 00.06 — 5 June 2009
User manual