I know this sounds strange. Is it possible to connect a single UART Tx to 2 UART Rx? Never seen this done before but I just wonder if this is possible.
No problem at all.
Erdin:
No problem at all.
Good. I think for data flowing in single direction, should not be a problem. For data flowing in both direction, will using RS485 be a good solution?
will using RS485 be a good solution?
Yes but there may be simpler ways, EG just tri-state buffers or software control of the IO pins.
What is distance and speed of the link?
Rob
Graynomad:
will using RS485 be a good solution?
Yes but there may be simpler ways, EG just tri-state buffers or software control of the IO pins.
What is distance and speed of the link?
Rob
It can be on the same PCB. 9.6kbps baud rate will be sufficient. Sorry, I am not very smart. How can tri-state buffers or software control help? UART is 1-to-1 protocol. How can we work around that with tri-state buffers and software control?
An RS-485 transceiver is just a fancy tri-state buffer and WAY overkill for this application, so you can use say a 74xx125/126 chip instead. Each side has to disable it's transmitter (Tx buffer) until it is allowed to talk and which time it enables the transmitter and spits data out.
All this requires a protocol that you have to write yourself although there must be a 1000 examples around.
Similarly you can manipulate the pins at each end to achieve the same result with no extra hardware but the software will be more difficult.
EDIT: Here's a drawing of a basic schematic
Rob
The trouble with that circuit is if both decide its time to talk. The two transmitters on the right have no way of knowing whether or not the other is trying to transmit, so it is possible to end up with bus contention, just as if the buffers weren't there.
In the case of that circuit, it looks as if you would be better having both enable pins connecting to the apparent master (left). The master can then select which of the two is transmitting. You could keep the enable pins connected to an input on the corresponding block on the right to tell that block when it is safe to transmit.
Or implement a software protocol:
Master: #1, give me data
#1: here you go
Master: #2, give me data
#2: here you go
Master: All, do some action.
Master: #1, are you done?
#1: yes, here's my status/error code.
Master: #2, are you done?
#2: No, here's my status/error code.
etc.
Both above protocols will work, given that the devices are on the same board Tom's might be easiest, but I was thinking along the lines of what Bob has suggested.
Rob