In message <01bd2b18$07724260$083d11ac@heartofgold.satellites.twin.dev> PICLIST@MITVMA.MIT.EDU writes: > >Philip Cowley wrote: > > > >> I need to count the pulses coming from a pair > >> of quadrature incremental encoders. > > > >Are these optical encoders, or mechanical? > > I have a matched pair of optical encoder disks which I am having mounten on > to shafts. The disks have 1458 lines, which produces 5832 quadrature > transitions. > > >The latter have _awful_ signals. > > I know... but reasonable optical encoders are not actually that difficult to > build. > > >What's the app? > > Ahhh there's the rub! > I am building a computer control system for a large astronomical optical > telescope. The telescope weighs about a ton (1000kg) and is driven by a pair > of synchro motors. These are currently controlled by some analogue > electronics from a small joystick. [snips] Phil, I would suggest that you don't do the quadrature decoding in the PIC, but rather use on of the decoder chips from either Texas or Hewlett Packard. I have used HPs HCTL2016 successfully in a PIC project. It has 16 pins, maintains 16 bit pulse count which is read using an 8 bit bus. In my project, I read the 2016 every 1ms adding the difference of the count into a 32 bit accumulator which is then multiplied by a 16 bit number for calibration before sending the most significant 32 bits serially to a DSP chip. Regards, Mike Watson