On Thu, 24 Jun 1999 00:09:00 +0930 Ross Bencina writes: >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. I'd probably use the switch to tap off a 12 resistor voltage divider, then go into a single analog input pin. However, since the 84 doesn't HAVE an analog input, you'd end up doing A/D with an RC circuit, as you suggest, then dismiss based on CPU time. There ARE 15 bit encoders, but they tend to be pretty big. Also, this'd use 4 I/O lines. A 16 bit shift register could bring in 16 lines using 3 I/O pins (data, clock, load). You could hang other shift registers on these same lines for even more I/O. Harold Harold Hallikainen harold@hallikainen.com Hallikainen & Friends, Inc. See the FCC Rules at http://hallikainen.com/FccRules and comments filed in LPFM proceeding at http://hallikainen.com/lpfm ___________________________________________________________________ Get the Internet just the way you want it. Free software, free e-mail, and free Internet access for a month! Try Juno Web: http://dl.www.juno.com/dynoget/tagj.