Mixing serial signals

Hello

Very quick question regarding serial communications. I have several Arduino serial communication TX's (all common ground), linked through a digital switch IC to a single RX on another Arduino processor.

All works fine. I can select the source I want, and it all works as expected.

However, there is a possibility that you could select two of the sources at the same time, and therefore they would be 'mixed' in the switch IC before leaving (it is a basic 4 pole 1 way switch IC).

I totally understand that the serial isn't going to work in any form, but will it cause damage? To my thinking (which may be incorrect), you are not exceeding the levels, just making a mess of them.

Otherwise, I may have to implement some complicated logic to ensure you cannot select more than one source at a time, but I was trying to keep the board as simple as possible.

Many thanks

...and what is your "mystery" IC?

Sorry - missed that

CD4066. Used it because I have boxes of the things

How many serial inputs? A bilateral switch does not make an ideal multiplexer because it lacks the selection logic. Do you have a connection diagram for your system?

You did say that you were trying to keep it as simple as possible…

4 serial inputs. I know a 4066 ia not ideal.... but I had some!

There is a very low chance of ever selecting more than one source at a time. It was a matter of.... will it go bang?

Otherwise, I need to search around and maybe find something else (I seem to remember a CD4051 was a 1 gang, 8 way switch... might have one of those). That would stop any chance of mixing.

Else it's either interconnected logic between the source processors, so they know if someone is sending, or some logic at the switch to only allow one switch to be opened at a time.

Well to answer the "bang" question honestly, requires seeing a schematic. It would also indirectly shed some light on how you would do selection in software, which is definitely relevant. There is no generic answer to your question.

Generally, I can tell you that if two pins of opposite HIGH and LOW polarity are connected together, it will exceed the maximum current spec of the output pins.

Can you control the transmissions from the multiple sources? You might consider an open drain, common wire polled approach instead...

OK Thanks. I will draw up a schematic tonight. Maybe have a hunt around for a better IC as well

Since serial is relatively slow, you can get away with series resistor buffering - perhaps 220 ohms. That would prevent pin damage in the case of a selection conflict.

Assuming you have wired it in such a way that only 1 input can ever be presented at the output you will be OK. However, as it would be possible using a 4066 to allow 2 or more inputs to the output then there is the possibility of damage.

I did the same thing as you but used a 4052, which is a 4 to 1 multiplexer with no possibility of 2 signals being combined. I used it for the same reason you used a 4066; I've got loads of them.

SteveRC2017:
I totally understand that the serial isn’t going to work in any form, but will it cause damage?
To my thinking (which may be incorrect), you are not exceeding the levels, just making a mess of them.

I think you are correct - you will get garbage but the max voltage will not exceed 5v

By the way, if you use the Master Arduino to control which slave speaks there is no need for a switch. You can connect all the TX’s together with a diode to isolate each of them and a pullup resistor at the RX. Like this

…R

R2-multiTX.jpg

"I totally understand that the serial isn't going to work in any form, but will it cause damage?"

Probably not as the TTL rx/tx are designed to be grounded as part of the communication protocol.

zoomkat: "I totally understand that the serial isn't going to work in any form, but will it cause damage?"

Probably not as the TTL rx/tx are designed to be grounded as part of the communication protocol.

Please elaborate. Is there some processor feature that I'm not aware of? The TX/RX pins (on the UNO, at least...) are connected directly to the processor I/O's. The limiting resistors that connect them with the USB UART are not in the circuit if TX is connected to ground.

aarg: Please elaborate. Is there some processor feature that I'm not aware of? The TX/RX pins (on the UNO, at least...) are connected directly to the processor I/O's. The limiting resistors that connect them with the USB UART are not in the circuit if TX is connected to ground.

I would assume voltage/current supplied to the tx/rx pins by the chip are within the current sink/source capabilities of those pins by design. Otherwise they might be "self smoking".

zoomkat: I would assume voltage/current supplied to the tx/rx pins by the chip are within the current sink/source capabilities of those pins by design. Otherwise they might be "self smoking".

The only current limiting on the TX output is the channel resistance of the digital output driver MOSFETs. Short circuit output current exceeds the safe range of output current. The absolute maximum is specified as 40mA but it should be limited to 20mA or so. Short circuit current has to be found empirically, but is likely much more than 40mA.

An output HIGH connected to an output LOW will have less current because the MOSFET resistances are in series, but it is still dangerously high (and unpredictable).

SteveRC2017: OK Thanks. I will draw up a schematic tonight. Maybe have a hunt around for a better IC as well

Maybe one at the bottom of this page.

I dug around the workshop and found an old CD4051, 8 way muiltiplexer (break before make). Barely any wiring changes required and that now means that I can never connect two serial sources at the same time. Seems to work fine.

Many thanks for the advice.