EDN logo


Design Ideas: April 11, 1996

Edited by Bill Travis & Anne Watson Swager,

RS-232C powers and reads 8-bit switch matrix

BR>Dhananjay Gadre, IUCAA, Pune, India


The circuit in Figure 1 provides a remote menu-selection switch matrix for PCs. It connects a linear, 8-bit switch to the RS-232C port; the RS-232C signal pins provide the circuit's frugal power requirements. You can easily modify the circuit to read more switch inputs. The heart of the circuit is a 74HC165 8-bit, serial-output shift register. It's important that you use either this register or a similar one from a low-power IC family. The shift register has eight parallel-input pins that receive their drive from an 8-bit DIP-switch matrix.

A low-going input pulse on the load-input pin transfers the 8-bit parallel inputs into the shift register. Subsequently, the bits shift out at the appearance of a high-going pulse on the clock-input pin. The serial-input pin on the shift register connects to 5V, but you could also use it to cascade multiple shift registers. The TX and RTX signals drive comparators IC2A, IC2B, and associated components. The TX and RTS signals from the RS-232C line generate the load and clock signals for the shift register. The outputs of the LM324 slew rather slowly. The 74HC14 Schmitt-trigger buffers in IC3 square up the waveshape of the load and clock signals to the shift registers.

Comparator IC2C translates the serial output of the shift register to RS-232C levels. The CTS input of the RS-232C line reads this output signal. Diodes D1 through D6 and capacitors C1 and C2 generate the ±VCC supplies for the comparators. A 78L05 regulator generates 5V from the +VCC line for IC1 and IC3. Figure 2 shows how the PC reads the switch matrix through the RS-232C port. The signals shown are those that appear at the shift-register pins. The clock pulses have a 2-msec width and 5-msec period. Listing 1 gives a sample program that controls the switch matrix. (DI #1850)


| EDN Access | feedback | subscribe to EDN! |
| design features | out in front | design ideas | departments | products | columnist |


Copyright © 1996 EDN Magazine. EDN is a registered trademark of Reed Properties Inc, used under license.