On 6/9/2013 6:43 PM, Manu Abraham wrote: > Hi, > > What's the best way to decode a rotary encoder (gray code) output, > when the outputs of the encoder are connected to edge detectors > both of which result in an IRQ each ? One thing I like to do if I don't have the free ports that are edge=20 changeable is using a small external PIC chip, you can get a 8 pin chip=20 that can handle multiple encoder and output the count on a single pin ,=20 then check the count with your main chip whenever you have the free=20 cycles. The extra chip doesn't have to have edge detectors since the=20 rotary decoding is all it will be doing. The extra chip can keep the count for you and the main chip can then=20 check the status of a single pin, any pin you like using a one wire=20 based communication to get the current count. Mark --=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 .