dsPIC30F Family Reference Manual
DS70063C-page 16-4 © 2004 Microchip Technology Inc.
16.2 Control and Status Registers
The QEI module has four user-accessible registers. The registers are accessible in either byte
or word mode. The registers are shown in Figure 16-3 and listed below:
• Control/Status Register (QEICON) – This register allows control of the QEI operation and
status flags indicating the module state.
• Digital Filter Control Register (DFLTCON) – This register allows control of the digital input
filter operation.
• Position Count Register (POSCNT) – This location allows reading and writing of the 16-bit
position counter.
• Maximum Count Register (MAXCNT) – The MAXCNT register holds a value that will be
compared to the POSCNT counter in some operations.
Figure 16-3: QEI Programmer’s Model
Register 16-1 and Register 16-3 define the QEI module control and digital filter control registers,
QEICON and DFLTCON.
Note: The POSCNT register allows byte accesses, however, reading the register in byte
mode may result in partially updated values in subsequent reads. Either use word
mode reads/writes or ensure that the counter is not counting during byte operations.
Bit 15
Bit 0
POSCNT (16 bits)
Bit 15
Bit 0
MAXCNT (16 bits)
Bit 7
Bit 0
DFLTCON (8 bits)
Bit 15
Bit 0
QEICON (16 bits)