Datasheet
2013-2014 Microchip Technology Inc. DS70000689D-page 259
dsPIC33EPXXXGM3XX/6XX/7XX
17.1 QEI Control Registers
REGISTER 17-1: QEIxCON: QEIx CONTROL REGISTER
R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
QEIEN — QEISIDL PIMOD2
(1)
PIMOD1
(1)
PIMOD0
(1)
IMV1
(2,4)
IMV0
(2,4)
bit 15 bit 8
U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
—INTDIV2
(3)
INTDIV1
(3)
INTDIV0
(3)
CNTPOL GATEN CCM1 CCM0
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 15 QEIEN: QEIx Module Counter Enable bit
1 = Module counters are enabled
0 = Module counters are disabled, but SFRs can be read or written to
bit 14 Unimplemented: Read as ‘0’
bit 13 QEISIDL: QEIx Stop in Idle Mode bit
1 = Discontinues module operation when device enters Idle mode
0 = Continues module operation in Idle mode
bit 12-10 PIMOD<2:0>: Position Counter Initialization Mode Select bits
(1)
111 = Reserved
110 = Modulo Count mode for position counter
101 = Resets the position counter when the position counter equals the QEIxGEC register
100 = Second index event after home event initializes the position counter with contents of the QEIxIC
register
011 = First index event after home event initializes the position counter with contents of the QEIxIC
register
010 = Next index input event initializes the position counter with contents of the QEIxIC register
001 = Every index input event resets the position counter
000 = Index input event does not affect position counter
bit 9-8 IMV<1:0>: Index Match Value bits
(2,4)
1 = Required state of Phase B input signal for match on index pulse
0 = Required state of Phase A input signal for match on index pulse
bit 7 Unimplemented: Read as ‘0’
Note 1: When CCM<1:0> = 10 or CCM<1:0> = 11, all of the QEI counters operate as timers and the PIMOD<2:0>
bits are ignored.
2: When CCM<1:0> = 00, and QEAx and QEBx values match the Index Match Value (IMV), the POSCNTH
and POSCNTL registers are reset.
3: The selected clock rate should be at least twice the expected maximum quadrature count rate.
4: The match value applies to the A and B inputs after the swap and polarity bits have been applied.