I've run out of IO pins on my current project, and have been watching the BCD discussion of how to get more info into less pins with interest. Here's the latest trick which has probably been used a hundred times already. You guys probably have a hundred more! Read two switches with one analog input line. Run one switch to ground in parallel with a 10k resistor, one switvh to 5 volts in parallel with 10K. Together they have three states - 0 volts, 2.5 volts, 5 volts. Only works when both switches can't be closed at the same time (I'm using this for a door open and door closed switch on a cd-player-like motorized drawer) Awfully hard to generate a real interrupt, have to poll the input to read the switch state. BUT saves one IO pin. OR TRY: Use the MCLR as a switch input. This required the program to reboot in response to a particular switch input. On one project we needed a STOP button that just sent the micro back to the beginning of it's program so this worked OK. Seems dangerous, though. > On Fri, 22 Aug 1997, Alec Myers wrote: > > > > > > >this could be done with one i/o line and about $3.75 USD in components > > > OR three i/o lines and about $1.00 USD in components > > > OR seven i/o lines and about .10 USD in components > > > OR twelve i/o lines and no additional components -- Lawrence Lile Download AutoCad blocks for electrical drafting at: http://members.sockets.net/~llile/index.htm