18.08.2013 Views

datasheet (3).pdf - EEWeb

datasheet (3).pdf - EEWeb

datasheet (3).pdf - EEWeb

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

dsPIC33FJ32MC302/304, dsPIC33FJ64MCX02/X04 AND dsPIC33FJ128MCX02/X04<br />

17.0 QUADRATURE ENCODER<br />

INTERFACE (QEI) MODULE<br />

Note 1: This data sheet summarizes the features<br />

of the dsPIC33FJ32MC302/304,<br />

dsPIC33FJ64MCX02/X04 and<br />

dsPIC33FJ128MCX02/X04 family of<br />

devices. It is not intended to be a<br />

comprehensive reference source. To<br />

complement the information in this data<br />

sheet, refer to “Section 15. Quadrature<br />

Encoder Interface (QEI)” (DS70208) of<br />

the “dsPIC33F/PIC24H Family<br />

Reference Manual”, which is available<br />

from the Microchip web site<br />

2:<br />

(www.microchip.com).<br />

Some registers and associated bits<br />

described in this section may not be<br />

available on all devices. Refer to<br />

Section 4.0 “Memory Organization” in<br />

this data sheet for device-specific register<br />

and bit information.<br />

This chapter describes the Quadrature Encoder<br />

Interface (QEI) module and associated operational<br />

modes. The QEI module provides the interface to incremental<br />

encoders for obtaining mechanical position data.<br />

The operational features of the QEI include:<br />

• Three input channels for two phase signals and<br />

index pulse<br />

• 16-bit up/down position counter<br />

• Count direction status<br />

• Position Measurement (x2 and x4) mode<br />

• Programmable digital noise filters on inputs<br />

• Alternate 16-bit Timer/Counter mode<br />

• Quadrature Encoder Interface interrupts<br />

These operating modes are determined by setting the<br />

appropriate bits, QEIM in (QEIxCON).<br />

Figure 17-1 depicts the Quadrature Encoder Interface<br />

block diagram.<br />

Note: An ‘x’ used in the names of pins, control/<br />

status bits and registers denotes a<br />

particular Quadrature Encoder Interface<br />

(QEI) module number (x = 1 or 2).<br />

FIGURE 17-1: QUADRATURE ENCODER INTERFACE BLOCK DIAGRAM (x = 1 OR 2)<br />

QEAx<br />

QEBx<br />

INDXx<br />

UPDNx<br />

Sleep Input<br />

TQCS<br />

2<br />

TQCKPS<br />

Synchronize<br />

TCY<br />

0<br />

Prescaler<br />

Det 1<br />

1, 8, 64, 256<br />

Programmable<br />

Digital Filter<br />

UPDN_SRC<br />

QEIxCON<br />

0<br />

PCDOUT<br />

0<br />

1<br />

Programmable<br />

Digital Filter<br />

Programmable<br />

Digital Filter<br />

3<br />

Existing Pin Logic<br />

1 Up/Down<br />

QEIM<br />

Quadrature<br />

Encoder<br />

Interface Logic<br />

3<br />

QEIM<br />

Mode Select<br />

TQGATE<br />

16-bit Up/Down Counter<br />

(POSxCNT)<br />

Comparator/<br />

Zero Detect<br />

Max Count Register<br />

(MAXxCNT)<br />

© 2011 Microchip Technology Inc. DS70291E-page 223<br />

1<br />

0<br />

2<br />

D<br />

CK<br />

Q<br />

Q<br />

Reset<br />

Equal<br />

QExIF<br />

Event<br />

Flag

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!