PORTA set as ADC is terribly easy to be damaged. So far, this is what I found. pin shearing can do saving pin, also. ----- Original Message ----- From: "Carey Fisher - NCS" To: "Microcontroller discussion list - Public." Sent: Friday, July 01, 2005 9:34 PM Subject: RE: [PIC] 1-pin 16 key analog keypad > > 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. > > > > > -Mario > > Mario, > Here www.ncsradio.com/schematics/keypad.pdf is an Eagle schematic > .pdf showing an 8 switch version of what you want. The signal > labelled PIC_AD_SW is tied to an A/D input pin on the PIC. > If you calculate the voltages for each switch pressed, > you'll see how this works. I use a table of the mid > voltage between adjacent switches as the decision point > for which switch is pressed. One feature of this design > is that multiple switches pressed at the same time will > not be confused with other switches; the lower number > switch always has priority. If you want some more info > on the algorithm I use for this design, let me know. > Carey > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist