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!