Multiplex your lines then you can get it down to 4 input lines. Use diodes to multiplex them, and remember to pull the lines high either with resistors, or internal pull ups if using PortB. I use this circuit in a microphone paging console giving me 31 buttons into 5 lines of an input port. And because it only uses 1n4148 diodes to multiplex it it costs very little. I've included a schematic as a wmf file. It is great for rotary switches, as it has only one common line, unlike most keypad multiplexing circuits, which scan the keys as rows and columns. ----- Original Message ----- From: Ross Bencina To: Sent: Wednesday, June 23, 1999 3:39 PM Subject: Best way to interface a 12 pos rotary switch > Hi PICsters, > > I have a 12 position single pole rotary switch that I'd like to interface to > a 16F84 and I don't have 12 spare IO pins ;) (Ideally I'd like to use 4 pins > or less). I've seen examples of using a resistor lader and an RC timer > circuit (uses too much cpu time for my purposes), presumably there's also a > logic chip (demux?) that will do the job, I'm just wondering if I've missed > any other obvious, minimal, and/or clever solutions to this problem. > > Thanks in advance. > > Ross B. > ................................. > http://www.audiomulch.com/~rossb/ > Content-Type: application/octet-stream; name="multi.wmf" Content-Disposition: attachment; filename="multi.wmf" Attachment converted: wonderland:multi.wmf (????/----) (0000905B)