Electrical – Upon setting up serial UART between two boards I can only monitor send or receive, not both, Why

rs232uart

I have an atmega389B talking to a SAMD21 chip over UART and am trying to monitor the data sent by the SAMD21 and 389B chip. The baud rate used to be 9600 8N1 and I was able to observe both the sent and received data between the two boards using an RS485 to USB sniffer with a 120 Ohm resistor between the RX and TX pins. The baud rate has since gone up to 38400 and Now I can only observe the data sent from one board or the other, not both, which I need to do. I can switch the TX and RX pins and get one set of commands or the other but I cannot receive both. The data is flowing between two RS232 chips and for some reason I was still able to reliably get TX and RX data with an RS485 sniffer. Now with a higher speed I cannot. Does anyone know what might be causing this and a solution to this problem? I tried a UART to usb sniffer but got gibberish and I have tried Teraterm and another cheap RS485 terminal program. I've tested the cables as well and they are working. I'm quite confused and could use some help. Here is a drawing of the setupenter image description here

Best Answer

The setup you've shown won't work. UART and RS-485 are very different electrically.

UART uses two unidirectional pins (RX and TX). RS-485 uses a single differential pair (commonly called wires A & B) for bidirectional communication.

To make it work you would need to add RS-485 transceivers next to the ATmega and SAM, only then the 3 devices could share a single bus.

Alternatively you could use two USB to UART converters, hook up their RX lines (one to the TX of ATmega, the other's RX to the TX of the SAM).