I am interfacing RCM3400 with icremental encoder which having the 9000 PPR. I want write down the code such as when moving the encoder in clockwise or anticlockwise the count is increamented but the position of the shaft should be displayed on o/p window.and the counter should be reseted after 9000 count. In built LIB files give me the count increamented upto long integer value. Problem is that before one revolution count is 9000, I got count 36535 approximately. What parameter i should change. I change the parameter QD_DIVISER, but no change in the count.
Hi,
The counter counts one encoder pulse as 4. The value should be 36000 in your case. I think, to display the actual value of the count, you need to divide the value by 4.
To detect the direction of the rotating shaft, you need to use the quadrature decoder INTERRUPT. when the counter goes from 0x00 to 0xFF or 0xFF to 0x00, it gives an interrupt. Inside the Interrupt service routine, you can see how the counter overflows. if it overflows form 0x00 to 0xFF one direction(say clock wise) If the counter overflows from 0xFF to 0x00 then the direction is anti clock wise.
If you go through the Rabbit user manual (quadrature decoder section) you can get all the information you needed.