> I coded things in assy and did not have problems but it was a user > interface on a radar detector and again on a speedometer / tachometer > system. when the A/D conversion was complete the code checked for a button > press (voltage drop) then did comparisons based on voltage measurement > with fairly wide tolerences (5 buttons, 8 bit conversion). The A/D ran in > the background and the "state machine" ran the button routine when the A/D > done flag was there from the main loop. Fast for a user interface does not > need to be fast as far as processor capabilities are concerned. The > processor ended running a 20 mhz crystal because of some more critical > timing issues. > Larry I did this in a 15 button system. I used SIP resistor networks for the voltage divider to get pretty good tempco matching. The pushbuttons just selected off the divider and drove the A/D input. I used SPDT switches "looping through" the unselected switches to avoid problems when multiple buttons were down. This also gave a priority order to the switches. The asm code was pretty simple. I put the ADC value in w, then added the negative of a half step of the voltage divider. If the result was negative, the input voltage was zero. I then successively added negative "full steps" to w, checking for a negative result on each, and branching to the appropriate code. Harold -- FCC Rules Updated Daily at http://www.hallikainen.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist