<< Previous | Next >>

qd_init

void qd_init( int iplevel );

Description

If your board has a Rabbit 3000A microprocessor installed, the quadrature decoder can be set for 10 bit counter operation. For 10 bit operation, add the following macro at the top of your application program.

   

#define QD_10BIT_OPERATION

If the above macro is not defined then the quadrature decoder defaults to 8 bit counter operation. With the Rabbit 3000 processor you must use the default 8-bit operation; defining the 10-bit macro will cause a compile time error.

Sample program Samples/Rabbit3000/QD_Phase_10bit.c demonstrates the use of the macro.

If your board has a Rabbit 4000 microprocessor installed, the quadrature decoder inputs must be chosen with one of the following defines. Define only one per quadrature decoder.

   

#define QD1_USEPORTD          // use port D pins 1 and 0
#define QD1_USEPORTEL         // use port E pins 1 and 0
#define QD1_USEPORTEH         // use port E pins 5 and 4

#define QD2_USEPORTD          // use port D pins 3 and 2
#define QD2_USEPORTEL         // use port E pins 3 and 2
#define QD2_USEPORTEH         // use port E pins 7 and 6

If no macro is defined for a decoder, that decoder will be disabled.

Parameters

iplevel
The interrupt priority for the ISR that handles the count overflow. This should usually be 1.

Library

QD.LIB (was in R3000.LIB prior to DC 10)


Dynamic C Functions << Previous | Next >> rabbit.com