On 7/1/05, Mario Mendes Jr. wrote: > Hi guys, > > I'm working on a little project and have just one i/o pin left in the > pict. Two things about it, first, is that I feel that really must find > something for that pin to do as not to go to waste =) and, second, I would > really like to include a keyboard/keypad in this project. I once saw a > "16-button analog keypad" circuit which used 1 pic i/o pin configured as > analog input, (obviously) 16 momentary switches and some resistors. The > theory behind it was that for each key pressed, a different voltage would > be present to the analog input and the pic could tell what key was from > that voltage. > > The only problem is that I tried all sorts of google search phrases and > can't find anything other than the usual 16 button keypad interfaces and > PC/AT keyboard interfaces. > > Anyone here has a link or details about how this is implemented? I would > be specially helpfull if you had a diagram WITH the resitor values in it > =) but I can try to come up with those values on my own if you have a > schematic (or a good explanation of how everthing is connected). > Thre are many way of doing this, and I've guess you have already got the answers: 1. use the ADC and a rezistive network divizor switched by buttons 2. use the comparator (internal or external) with the internal voltage reference which has the required resolution 3. use an RC network with a fixed C and a keypad switched resistor network and measure a time variation 4. use a paralel to serial converter and share the clock pin required with other function best regards, Vasile -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist