|
How do these "encoders" of yours work ?
With the encoders that look like pots, that I just found on pages 830-831 of the DigiKey catalog, you have two "quadrature" outputs that you have to use to determine the direction, and also count one of them (or count all the transitions on both, for more resolution). The duration of the pulses is dependent on the speed of rotation, and the RC cannot be programmed to read them reliably if the pulses don't last exactly 26 ms. To be better than a pot, you would want 128+ bits / rev, which would make the motion awfully slow. If in quadrature, you would need 52 ms x 128 = 6.6 seconds to turn one rev.
They have open collector outputs, and so they will need pull-up resistors, as mentioned in another reply, above. 10k from +5V to the encoder output ought to be ok.
=-=-=-=-=-=-=-=-=-=
A PIC operating on an interrupt-on-change is a real nice thing to have with these, because it can keep up with the pulses (it notices things every microsecond) and it could count the pulses, as does a mouse. Reporting back to the RC is possible too, possibly using the programming port of the RC.
Any other way for a PIC to talk to the RC via an analog input reduces the data to 8 bits anyway, so why not use a pot ?
Last edited by Lloyd Burns : 08-03-2003 at 08:08.
|