I stumbled into a technique that allows more than one momentary switch per pin while troubleshooting a VHF transceiver. FWIW, it is not a new idea but it is the first time I've found it in a product - oddly on a processor that seems to have plenty of available I/O. Perhaps there is an advantage that isn't immediately obvious.
Two or more switches can be configured to change a voltage divider and, in turn, the voltage presented to an analog input. In the case I found in the radio, closing SW1 puts 0v on the pin, and closing SW2 puts ~2.25v on it; the pin is pulled to +5v if both switches are open. A longer voltage divider and more switches are possible, of course, perhaps limited by reliably discernible values - and the confusion of multiple switch closures. Two switches assures that one switch overrides the other.
Multiple switches per pin
Tom,
Microchip has published several Tips & Tricks full of ingenious ways to extend the capabilities of a pin. Here's one from 2009.
http://ww1.microchip.com/downloads/en/D ... 01146B.pdf
Microchip has published several Tips & Tricks full of ingenious ways to extend the capabilities of a pin. Here's one from 2009.
http://ww1.microchip.com/downloads/en/D ... 01146B.pdf
Here is the link where you can find more information on it - http://arduino.cc/forum/index.php/topic,20125.0.html
What are the benefits with multiple switches per pin, if you have many I/O lines are available?
pcb assembly quote
What are the benefits with multiple switches per pin, if you have many I/O lines are available?
pcb assembly quote
Last edited by arin on 15 April 2013, 16:49 PM, edited 2 times in total.
cheers
The simple answer is it allows the use of a rotary switch. Also, it conserves I/O pins because you often do not have enough I/O even when there are a lot of them.arin wrote:Here is the link where you can find more information on it - http://arduino.cc/forum/index.php/topic,20125.0.html
What are the benefits with multiple switches per pin, if you have many I/O lines are available?
I made an 8-position rotary switch with no problem in resolving the poistion with 100% accuracy while measuring the ADC voltage.
-Tony