FOr an example, this is done for switch decoding on the Pocket Programmer (a good PIC programmer). The schematics are at www.bubblesoftonline.com, and show a schematic for four button control. It dooes indeed use a resistor ladder to determine the voltage input to a single A/D port on the PIC. Rgs Ian. -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Olin Lathrop Sent: Thursday, 27 February 2003 12:57 am To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: A to D convertor use for switch decoding > Not necessarily. It is potentially (no pun intended) possible to detect > any and all switch states. Yes, if you use R/2R ladder. However, that severly limits the number of switches based on the accuracy of the resistors, as you pointed out. I straight muli-tap divider allows for more switches with lower tolerance parts, but does have the priority issue. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads