Quadrature Decoder not functioning

Good day.
I am trying to use the Quadrature Decoder on Rabbit 6000 with the RCM6700 kit. For some reason it does not work properly, the value returned (either by qd_read function or by reading the QDC1R register) is always 0.

I am using it the following way:

#define QD1_USEPORTD
#define QD2_USEPORTD //Using port D

int main(void) {

qd_init(1);

//some time after the encoder sends the pulses
ires = qd_read(1); //Always returns 0
// Tried ires = RdPortI(QDC1R); - same results

I also tried to manually set up timers the following way (before qd_init):
WrPortI(TAPR, &TAPRShadow, 0x01); //Preselector to divide by 2
WrPortI(0x00A2, &TAECRShadow, 0x00); //TAECR (for some reason the Dynamic C does not recognize TAECR as a defined value), for the Timer 10 to be clocked by TAPR
WrPortI(TACSR, &TACSRShadow, 0x01); //Enable Timer A

But it didn’t work either.
What could be a cause? Am I missing some step?
And I would also like to know, are there any samples for QD usage? I failed to find any.
Thank you!

You might be able to adapt one of the quadrature decoder samples from Dynamic C 9.62 (See Samples/Rabbit3000/QD_*.C).

Have you confirmed the signals going into the ports on the Rabbit by using a scope or logic probe?

The sample code is fairly simple:


void main()
{
    long reading1, reading2;
                
    qd_init(1);
    qd_zero(1);
    qd_zero(2);

    while(1)
    {

        // this costate prints out the decoder values twice per second
        costate {
            reading1 = qd_read(1);
            reading2 = qd_read(2);
            printf("qd1: %10ld      qd2: %10ld
", reading1, reading2);
            waitfor(DelayMs(500));
        }

        // this costate zeroes QD channel 1 every 5 seconds
        costate {
            waitfor(DelaySec(5));
            qd_zero(1);
        }
    }
}