Datasheet

2009-2012 Microchip Technology Inc. DS70594D-page 193
dsPIC33FJXXXMCX06A/X08A/X10A
17.0 QUADRATURE ENCODER
INTERFACE (QEI) MODULE
This section describes the Quadrature Encoder Inter-
face (QEI) module and associated operational modes.
The QEI module provides the interface to incremental
encoders for obtaining mechanical position data.
The operational features of the QEI include the
following:
Three input channels for two phase signals and
an index pulse
16-bit up/down position counter
Count direction status
Position Measurement (x2 and x4) mode
Programmable digital noise filters on inputs
Alternate 16-Bit Timer/Counter mode
Quadrature Encoder Interface interrupts
The QEI module’s operating mode is determined by set-
ting the appropriate bits, QEIM<2:0> (QEIxCON<10:8>).
Figure 17-1 depicts the Quadrature Encoder Interface
block diagram.
FIGURE 17-1: QUADRATURE ENCODER INTERFACE BLOCK DIAGRAM
Note 1: This data sheet summarizes the features
of the dsPIC33FJXXXMCX06A/X08A/
X10A family of devices. However, it is not
intended to be a comprehensive refer-
ence source. To complement the infor-
mation in this data sheet, refer to Section
15. “Quadrature Encoder Interface
(QEI)” (DS70208) in the “dsPIC33F/
PIC24H Family Reference Manual”,
which is available from the Microchip
web site (www.microchip.com).
2: Some registers and associated bits
described in this section may not be
available on all devices. Refer to
Section 4.0 “Memory Organization” in
this data sheet for device-specific register
and bit information.
16-Bit Up/Down Counter
Comparator/
Max Count Register
QEAx
INDXx
0
1
Up/Down
Existing Pin Logic
UPDNx
3
QEBx
QEIM<2:0>
Mode Select
3
(POSCNT)
(MAXCNT)
PCDOUT
QExIF
Event
Flag
Reset
Equal
2
T
CY
1
0
TQCS
TQCKPS<1:0>
2
Q
Q
D
CK
TQGATE
QEIM<2:0>
1
0
Sleep Input
0
1
UPDN_SRC
QEIxCON<11>
Zero Detect
Synchronize
Det
1, 8, 64, 256
Prescaler
Quadrature
Encoder
Interface Logic
Programmable
Digital Filter
Programmable
Digital Filter
Programmable
Digital Filter