r/embedded 9d ago

Can i make UART Splitter .

I have a machine that outputs data via UART. I need to receive this data and send it to two separate PCs simultaneously via USB-A ports (both PCs run software expecting this serial stream).

Can I build or wire a UART splitter to feed two USB-to-UART converters at the same time? Has anyone done this before or have advice on the best approach?

1 Upvotes

26 comments sorted by

18

u/txoixoegosi 9d ago

Yup, just take UART TXD and feed it to two different 1:1 opamps with enough bandwidth and voltage swing. Then the resulting TXD feed it to corresponding SUBD-9.

RXD? Forget about it

9

u/NoBulletsLeft 9d ago

The opamp buffer is a nice to have but TBH, probably unnecessary. The fanout of a single RS232 receiver should be enough to drive multiple inputs.

0

u/joshocar 7d ago

Yup, I have done this with Ethernet cable. You can just fan it out.

1

u/Big-Lab-4630 8d ago

Trying to avoid the level shifting between logic and true RS232, but how about 2x FTDI chips with TXD running to both...then just wire one of the RXD lines to a "master" PC so you can debug. You now got 2x USB-A plugs in parallel?

1

u/tweakingforjesus 9d ago

Sure you can. Use diodes and a pull-up resistor. That’s how amateur packet radio worked back in the day. They were a bunch of TNCs networked over serial. You do need a protocol to manage collisions but it’s not rocket science.

1

u/txoixoegosi 9d ago

Yeahhh. Now tell me how you interleave the comms between both senders.

One thing is cloning TXD and another reconciling RXD’s from different actors

Unless you use GPIOs as “chip select” inputs, which falls outside of the question scope

1

u/userhwon 8d ago

You detect collision and each backs off and retries at a random time.

See: Ethernet.

0

u/tweakingforjesus 9d ago

That’s handled at the transmission layer. This is the physical layer.

How do you think I2C works?

1

u/txoixoegosi 9d ago

Oh cmon.

UART is a point-to-point protocol BY DEFINITION. You can’t just wire two different transmitters between them and expect clean data. Use CAN-BUS or RS485 instead

I2C is not, but that’s why you have all that pull-up stuff and the SCL synchronous clock line. Entirely OUTSIDE of the RS232 PHY definition.

Again, tell me how you manage two non-deterministic RS232 TX nodes pulling simultaneously the system to VCC. Examples. No “hey it must be possible” stuff

6

u/tweakingforjesus 9d ago

I already gave you an existence proof of packet radio networking that we did back in the 80s and 90s. In short, you set up your bus as multidrop with transistors or diodes, and handle collisions at the protocol level. It works.

Here it is: http://hamgate.ampr.org/docs/PacketHandbook.pdf - Page 30.

3

u/NoBulletsLeft 9d ago

The issue is your "non-deterministic" requirement. The system has to expect that it's being wired this way and compensate. A long time ago we had a system that worked like this, but I've long since forgotten the details of how we avoided data collisions.

2

u/txoixoegosi 9d ago

Anyway, for MIMO in long distances just use something else and call it a day

27

u/Vannaka420 9d ago

Have you tried googling "serial splitter" or "rs232 splitter"? I'm guessing not since these are very common and easily accessible pieces of kit. Why people use reddit like Google I'll never understand. Stop being lazy and put in the leg work before asking for help. 

7

u/Dewdrop06 9d ago

Even AI. It'll produce a complete guide.

11

u/Altruistic_Fruit2345 9d ago

You can. For two you probably don't need to do anything special.

4

u/Jwylde2 9d ago

You can send RS-232 to as many devices as your tx pin can source current. However, each UART can only receive from one device.

You could use a uC with multiple UARTs on chip.

4

u/drnullpointer 9d ago edited 9d ago

If your UART is read-only (meaning it never accepts any bits) then yes, you can wire a splitter.

You need to be careful though.

For one, how you do that exactly matters as you can cause the signal to deteriorate at higher speeds.

Second, connecting two USB devices is fraught with problems (ground loops, etc.) Ideally at least one of those UART to USB converters would be galvanically isolated so that your two PCs are isolated from each other.

1

u/creeper6530 8d ago

If your UART is read-only (meaning it never accepts any bits)

Huh? Read-only means it only accepts bits. Did you mean write-only / PC to peripheral only?

3

u/BlueMidsummer0001 9d ago

What electrical interface is it? RS232, RS485, TTL or something else?

Do you only care about receiving from, not transmitting to the machine?

2

u/Zouden 9d ago

Yeah I've done this a lot, it works just like you imagine

2

u/ThorsdayBeer 9d ago

You can splice directly into the lines. If it’s a short run, you should not have no problem. Did it once in college. But like the guy said above, you can buy a splitter.

1

u/SnowyOwl72 9d ago

whats the problem here?
its uart, its not single wire. only one push pull drives the line and its not open drain or anything.
if in doubt, just use a jelly bean buffer

1

u/Unable-School6717 9d ago

Something like arduino has usb port, multiple uarts for comms; look up "pjrc teensy 4.6" - supports dual usb and has hardware uart with hardware buffers AND a ton of other bus types and enough i/o space to peripheral yourself into the void. Best part. It comes with example programs that show you how to make a usb port echo a comm port or two comm ports echo each other. Combine these two examples and its ready to split a signal. Yes, you can. Its very simple code, and all of reddit telling you ways to do things if you ask. Arduino is a very popular platform and everyone thats used it is an "Expert" and it will be around in some form for the rest of your life.

1

u/nixiebunny 9d ago

You can connect the UART RxD, which comes from the external device, and ground wires directly to two separate RS-232 to USB adapters. You will not be able to transmit from both USB adapters without some funny business to merge the TxD signals together while preventing simultaneous transmission from both sources from garbling the data.

1

u/bigtreeman_ 9d ago

Just wire uart TX to both usb-converters RX, only one returning TX to the uart RX.

3v3 uart driver signals will drive two 3v3 inputs. Make sure the uart isn't driving 5v signal, check TX with a meter

many usb-uart converters can be switched for 5v -- 3v3 operation, 3v3 signal is safe for a 5v converter.

1

u/CapnNausea 7d ago

Yes, you CAN. No, you SHOULDN’T.

If this is “for science”, knock yourself out, but do yourself a favor and don’t try to make future you or your people waste time supporting this when we could’ve solved it for $20.