Why doesn't qd_read(1)

I’m not able to read the value of the second and third quadrature decoder input. When I connect an encoder to DIN18 and DIN19 on my BL2600 I’m able to read the input by using qd_read(0) or qd_read(2).
However when I connect an encoder to DIN20 and DIN21 I’m not able to read the input by using qd_read(1).
Do I have to configure something in a .lib file?

Probably because QD_Init() sets up the lower nibble of port F to be the QD input pins. You are trying to use the upper nibble.

It had something do with the pins. I now use the statement: #define QD1_USEPORTFH to select the right pins for the BL2600. Thanks for the reply!

Can you tell me in what library this define is used?

By writing a certain value in the QDCR register you can make this setting yourself.

WrPortI(QDCR, &QDCRShadow, 0xCD);

// 0xCD = 1100 1101
// bit 7 1, Enable QD2 inputs.
// bit 6 1, QD2 inputs from PF7 and PF6 (DIN23/DIN22).
// bit 5:4 xx, These bits are ignored.
// bit 3 1, Enable QD1 inputs.
// bit 2 1, QD1 inputs from PF5 and PF4 (DIN21/DIN20).
// bit 1:0 01, QD interrupts are enabled at interrupt priority 1.

You are trying to use the upper nibble.

I’m using the R3000.LIB library