Comments in-line. At 03:02 AM 12/23/2013, CDB wrote: >I've been asked if I can conjure up a device that will allow 6 incrementa= l >rotary encoders and 10 ADC inputs. I suspect this is for some sort of >gaming doodad. > >I'm wondering on what the lists thoughts are on saving 12 port pins with >the following. > >Attach channel A of all the encoders to a single interrupt on change pin. >The IOC will look for high to low and then low to high. This won't work. Assume that the encoders are open-collector (or=20 mechanical switches) that go to Ground when closed. When any one encoder is in a position that channel A is grounded,=20 none of the other encoders can change that pin. You will see changes=20 on the individual channel B lines, but without seeing the changes on=20 the channel A line, you can't tell direction. Also note that the method you are proposing, which is treat channel A=20 as the clock line and channel B as the direction line; can suffer=20 from false counts because of jitter on the channel A line. That is:=20 assume that the encoder is right at the transition point for channel=20 A. You get clock edges but no direction changes. This results in=20 false counts. Been there, done that, learned NOT to do it that way . There are a couple of ways to do this. But, honestly, I'd dedicate=20 either a small PIC (with enough pins for all 12 encoder lines) and=20 poll the pins at a very fast rate. Then use the standard 4-entry=20 lookup table for each of the encoders or, if you are feeling=20 ambitious, the also-standard 4-state state machine for each of the encoders= .. dwayne --=20 Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax www.trinity-electronics.com Custom Electronics Design and Manufacturing --=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 .