This is a multi-part message in MIME format. --------------080300000102050707000004 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I've worked on this problem some time before. I have used different resitors. I used 8-bit-adc. Each resistor is choosen to set 1 bit in the result. The lower 3 or 4 bits are ignored, because of the differences in resistors and measuring. I think you can use max. 5 resistors/bits/switches, but it is possible ! 4 resistors are connected to 5V: 22k 66k5 154k 330k they are switched together to 1 resistor of 22k against ground. So you can measure the voltage over the 22k-resistor towards ground. This will be 4 bits (the high ones of the byte!) and you add %00001000 to the result in order to round the result. Maybe it is possible to expand the system ! Marcel Birthelmer schrieb: > Bob, > how did you deal with the possibility of more than one switch being pushed > at a time? Did you just verify the math to make sure that there is no > overlap in the output voltage ranges? > - Marcel > > On 8/14/06, Bob Axtell wrote: >> I have a standard design that handles up to 7 pushbutton switches (as in >> membrane switch) on just ONE PIC analog input pin. It works very >> well, maintains a good input impedance, so needs NO special analog >> input processing. >> >> I was asked to share the design with another PIC engineer, so I might as >> well share it with anyone that wants it. It will be in ZIP form, and will >> contain PDF schematics and ASCII TEXT code for the PIC16F876A >> with easily ports to just about ANY PIC with an A/D converter.. >> >> Each switches contacts to GND a point within a resistor array. The >> A/D seems a voltage of 0.0V, 0.7V, 1.4V, 2.1V, 2.8V, 3.5V, and 4.2V. >> 5V means no switches are pressed. A small software window is built >> around each value, so an amount of error is tolerated; for example, >> rubber button switches normally measure 100 ohms when closed. >> >> Please note that this works for 7 pins PER ANALOG PIN. That means >> for the 8-pin analog switching of the PIC16F877A, up to 56 switches >> can be handled with ease. >> >> I read the switches every 1mS but that is because the design is a serial >> keypad. >> For most applications, reading every 10-30mS should be fine. >> >> If anyone wants a copy, just ask. >> >> --Bob >> >> -- >> http://www.piclist.com PIC/SX FAQ & list archive >> View/change your membership options at >> http://mailman.mit.edu/mailman/listinfo/piclist >> --------------080300000102050707000004 Content-Type: text/x-vcard; charset=utf-8; name="bernd.rueter.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bernd.rueter.vcf" begin:vcard fn;quoted-printable:Bernd R=C3=BCter n;quoted-printable:R=C3=BCter;Bernd org:Promaxx;Entwicklung adr;quoted-printable;dom:;;W=C3=BClferoder Stra=C3=9Fe 10;Hannover;Nds;30539 email;internet:bernd.rueter@promaxx.net title:Dipl.-Ing. tel;work:+49 511 3746207 tel;fax:+49 511 3746208 note:Meine Kontakte sammle und pflege ich in OpenBC: http://www.openbc.com/go/invite/3470477.7f1d19 url:http://www.promaxx.net version:2.1 end:vcard --------------080300000102050707000004 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --------------080300000102050707000004--