>For argument's sake, lets say I want to use up to 30 feet of >cable. The output of the encoder chip will drive the cable, >which will drive the inputs to a PIC. I don't really see the >need in adding a dedicated decoder to the circuit. BCD would >be ideal, as I could squeeze 16 pushbuttons in 4 lines. >Any suggestions? I would look at using one of the very cheap PICs as a keyboard scanner/encoder. Then you can send the data in whatever form suits you best. Something like a 16F630 which comes in a 14 pin package, and has internal oscillator would be ideal for this. You get 10 I/O pins, so should not have too large a job with the keyboard matrix, even if using 4 pins for transfer to the other PIC, although personally I would bit bash a serial protocol which would be self clocking, thereby needing only one pin for the communication. >My second question is about ADC. I need 24 channels of ADC in another >circuit, and I am unsure of the best way to go. I just need 8 bit >resolution, so that isn't really a stumbling block. My two thoughts are >to either use an external ADC, or multiple ones, or to use an analog >switch to multiplex the PIC16f877's internal 8 channel ADC. The only >problem here is that I am measuring a 50K pot, and the input inpeadence >of the f877's convertors is 10K right? I don't really want to have 8 >impeadance matching circuits, and I wouldn't even know where to start >designing one (well, opamp, I know that much). If I was to go the switch >route, I was looking at Maxim MAX336 (16:1 switch), or more likely, the >MAX337 (2x 8:1 switch). Any thoughts on these? I have used a 4067 CMOS mux to get 16 channels into a 16F876. For your use I would use two of them, and use the enable line to switch between which is the active one, and feed them all into one ADC on the PIC. You would then need a single op-amp as a buffer between the muxes and the PIC. Then you require 6 I/O lines to address the 4 address lines and 2 enables. I think you would find this easier to do than try to use 16 externally muxed ones, plus 8 internal to the PIC, as you would still need one of the internal ADC lines as the input from the MUX, and if all your pots are 50k, then you would need a buffer on all PIC ADC inputs. However you may find that a search of the Maxim or Analog Devices ranges will produce a suitable ADC that you can interface through SPI or I2C, which may work nicer for you. I know they both produce some multi port devices, but have a feeling most of them are DAC chips. You will need to check for yourself, I think I have thrown out the flyers I was getting. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics