On July 1, 2005 12:34 pm, 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). If you search the archives of the piclist for: "[PIC] Matrix Keyboard Philosophy" It was recently discussed (approx April 9 2005) and has a few ideas. Personally, I somewhat like the idea similar to reading a PC joystick or a 555-type timer, by discharging a capacitor, then timing the amount of time needed to achieve a crossover from 0 to 1 bit (see AppNote 512): http://ww1.microchip.com/downloads/en/AppNotes/00512e.pdf There are also other valid ideas there as well. As a side note, reading 4 bits via an analog method is easy, 8 is tougher, and 16 may be somewhat difficult due to noise on the power lines or other induced noises. > Thanks in advance. > > > -Mario -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist