Patrick J wrote: > > I am wondering, have anyone tested max speed for a polled program > decoding an rotary encoder ? Would an interrupt driven program > do better ? > > PIC16F877 @ 20 MHz. Approx 50 instuctions in the active loop > Encoder is 100 pulses/rotation, quadrature decoding (400 flanks/rotation) > I have reached around 2000-2500 rpm. 3000 rpm gives overspeed error. A suggestion, why not get some black paint and with a fine brush fill in every second hole, giving you 5000 rpm straight away, at small cost of losing a bit of positioning accuracy? VCR repairers always have a little jar of black paint near their bench. :o) -Roman -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.