Jonathan Hayes wrote: > > I've been asked to work with an Optical Encoder and a display with the > capability of updating the readings relatively fast. > > Since I've never worked with an optical encoder, my 1st thought was to > use a PIC. I was told that the logic may be too intense. Is this > true? Is there an interface to these things? All I know is that I've > got two square waves that I have to count and determine which leads the > other. My thought is that the speed may be the issue. > > Any help would be greatly appreciated! (assembly code would be > wonderful) > > Any good links for sources of info available? I don't want to re-invent > the wheel if I don't have to. > > Jon What's 'relatively fast'? How fast is the wheel turning? If you have a 400 slot optical encoder on a turbine shaft, a PIC won't cut it. If it's on a knob being turned by somebody, it will. An optical encoder typically puts out "quadrature" -two 10101010101 streams that are 90 degrees out of phase. By checking which is leading, you know which way th e wheel moved. What the signal looks like, wheel turning ccw: LR 00 01 11 10 00 01 11 10 00 01 11 10 00 01 11 10 What the signal looks like, wheel turning cw: LR 00 10 11 01 00 10 11 01 00 10 11 01 00 10 11 01 -- Anniepoo Need loco motors? http://www.idiom.com/~anniepoo/depot/motors.html