slippyr4 gmail.com> writes: >=20 > Hi all, >=20 > I want to count pulses from a rotary encoder who's output is 2 channel gr= ay > code. I need to increment a counter when the encoder turns one way, and > decrement it when it turns the other way. You can use only 1 interrupt, and look at the state of the other pin.=20 Example: interrupt on L channel, then check R channel. If R is high, then increment count, if R is low - decrement. You might need debouncing on L channel (or inhibit subsequent interrupt for some time), but not on R channel since the channels are 90 degrees out of phase, which provides sufficient time for the contact to settle.=20 Also, some PICs have hardware quadrature decoders which might be beneficial to use, depending on your application. Sergey Dryga http://beaglerobotics.com --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .