The main problem I see with reading the state at discrete times, as opposed to using an interrupt is that at certain speeds, you will miss steps of the quadrature. So the usual steps for three quadrature in one direction are 0,1,3,2,0,1,3,2,0,1,3,2. So you may end up reading 0,3,2,1,2,0,3 (or something similar), and I don't know how the program would interpret this.MikeB wrote:We should be able to read it every 10mS (100 per second). The encoder in this thread only gives 24 steps per revolution, so we should be able to handle uo to 4 revs/second, can you turn it that fast?
My suggestion of using a counter chip, means that it could be read maybe 10 times a second and it would know how many pulses were counted very efficiently. Using a small micro would be just as easy and could be considered part of the hardware addon required for the encoder with a static program that doesn't change, and wouldn't need firmware upgrading once implemented. Lets face it, it would only be a handful lines of code to have two interrupt pins calling an interrupt that either increments or decrements a counter, then outputs this value before resetting to 0 when polled through I2C.