Microcontroller multiplexes DIP switches


Posted on Apr 24, 2012

At times, a µC must read a large number of DIP switches, such as for system identification, bus-address setup, manual configuration, or other purposes. However, the available number of I/O lines is sometimes not enough to assign a switch to each one. You can use multiplexer ICs to share one I/O port with multiple switches, but they complicate the circuit, dissipate additional power, and consume precious board real estate. Figure 1 shows a method of multiplexing 32 DIP switches using only 12 I/O pins and eight pullup resistors. Four 8-bit DIP switches connect in parallel to a single 8-bit I/O port.



A pullup resistor on each port pin defaults the input to a high state; a switch closure pulls the input to a low state. The key to multiplexing the DIP switches is to ground each set of eight switches in turn using output pins from a second I/O port. o




Leave Comment

characters left:

New Circuits

.

 


Popular Circuits

True rms detector
70w stk amplifier schematic
Audio Clipping Detector Circuit
SPI
Robot shield for Arduino
TV Muter Circuit



Top