switch matrix .... do these exist?

Thread Starter

vortmax

Joined Oct 10, 2012
102
I have various devices in the lab that I connect to over serial. Some are rs232, and some are rs485 and most of the rs485 have their own special pinout. This makes it a pita to debug anything as i need a different adapter for every device.

To fix this I want to make one adapter that connects a db9 to both an rs485 transceiver and a rs 232 line level converter through a switch matrix that is controlled by a micro. By adding a second com port to the usb side, I could connect to the micro and load a profile that will map the pins on the db9 to the proper rx/tx/gnd pins on the proper converter ic.

I believe an analog multiplex could do this, but I believe that would only be one channel, meaning I would need multiple chips. Are there any single ic packages that can pull this off?
 

crutschow

Joined Mar 14, 2008
34,420
An analog mux should work. Analog multiplexer chips typically have 1 or 2 I/O ports going to 4 or 8 I/O ports so you would need multiple chips for all the db9 lines. Make sure the mux can handle the voltage excursion of the signals.
 

MrChips

Joined Oct 2, 2009
30,802
If these are commercial devices that are interconnected then there is not much you can do.

If you are designing your own system with multiple devices there is an organized solution.
Convert all interfaces to RS-485 and make each device addressable. You then network all devices on to one RS-485 connection and then they can talk to each other seamlessly.
 

Thread Starter

vortmax

Joined Oct 10, 2012
102
This is a debug bridge. One device patched into a laptop to troubleshoot it. We do have quite a few devices that are addressed rs485, but the pinout changes vendor to vendor. We also have quite a few rs232 devices. I just want to simplify my tool box and make something I can adapt to any situation without a soldering iron.

Do they still make GAL chips? I did some research and it seems that or a FPIC would be perfect.
 

ScottWang

Joined Aug 23, 2012
7,399
I'm just thinking about this, it may needs some change :

Mcu → 74HC138 → CD4051 → CD4066 → Switching between the Device and RS232 or RS485.

The Mcu send the enable signal to choosing the CD4051, and CD4051 to control the CD4066, the CD4066 switching the signal between the Device and RS232 or RS485.

You may need some CD4051 and CD4066.

Parts search engine.
http://www.datasheetcatalog.net/

You also can use some small reed realys to replace the CD4066, but you would need more.
 

Thread Starter

vortmax

Joined Oct 10, 2012
102
Thanks for that. Tell me if if this arrangement sounds reasonable.

Connect each pin to one bilateral switch. One pole is tied to ground while the other is tied to a "signal" line. Each signal line is tied to another bilateral switch which will switch the output between the tx and rx bus. Two final switches will handle switching each bus between the rs232 and rs485 transceivers. That is a total of 20 bilateral switches, or 5 cd4066's.
 

crutschow

Joined Mar 14, 2008
34,420
With analog muxes or switches you need to consider the voltage levels. For example the CD4066 has a limit of 15Vpp, thus it could not switch an RS-485 +12V to -7V signal. You could possibly use a high voltage switch such as one of these rated for 36V or more. They also sell multiplexers rated for high voltage.
 
Last edited:

crutschow

Joined Mar 14, 2008
34,420
Thanks for that. Tell me if if this arrangement sounds reasonable.

Connect each pin to one bilateral switch. One pole is tied to ground while the other is tied to a "signal" line. Each signal line is tied to another bilateral switch which will switch the output between the tx and rx bus. Two final switches will handle switching each bus between the rs232 and rs485 transceivers. That is a total of 20 bilateral switches, or 5 cd4066's.
Why would you want to connect the signals to ground? :confused: That will short the signal, which is normally not desirable.
 

Thread Starter

vortmax

Joined Oct 10, 2012
102
Each pin would have its own switch to flip it between signal and ground. Then each pin's signal line would be switched between common rx and tx buses, which would then be switched between the tranceivers. So any pin can be routed to the tx or rx pin on a tranceiver, or grounded.
 

Thread Starter

vortmax

Joined Oct 10, 2012
102
The rs232 spec says +-3V defines a state and rs485 only needs a 200 mV differential. Since I will be using very short cable runs, couldn't I limit the voltage at the pins with diodes to pull it into range?
 

crutschow

Joined Mar 14, 2008
34,420
Each pin would have its own switch to flip it between signal and ground. Then each pin's signal line would be switched between common rx and tx buses, which would then be switched between the tranceivers. So any pin can be routed to the tx or rx pin on a tranceiver, or grounded.
That's OK as long as you never connect a signal output to ground (that wasn't clear from your description)
The rs232 spec says +-3V defines a state and rs485 only needs a 200 mV differential. Since I will be using very short cable runs, couldn't I limit the voltage at the pins with diodes to pull it into range?
That would reduce your noise margin but likely would be ok. You would need a resistor in series with the signal and and diodes to the plus and minus clamp voltages. But just using a higher voltage switch will be easier and cheaper.
 
Top