0
\$\begingroup\$

I want to use a UART bus (RX-TX-GND) to communicate between one master and multiple slaves.

NUCLEO-F401RE board is the bus master. B-L072Z-LRWAN1 and ESP32 are the slaves.

Communication over UART works between master and one slave at a time. However, when I connect both slaves to the bus, communication stops working. Of course, I made sure that only one slave is sending at a time so I do not see where is the problem.

Can it be due to UART pullup resistor configuration? I have tried different configurations but nothing works for now.

\$\endgroup\$

closed as unclear what you're asking by Elliot Alderson, Warren Hill, RoyC, Tony Stewart Sunnyskyguy EE75, Finbarr Apr 30 at 22:59

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ Do you have any arbitration on the "Bus"? It's not enough to connect to make it work. Usually the RS-485 standard is used for multi-drop topology and some kind of arbitration (like 9th-bit address marking) is used. \$\endgroup\$ – Eugene Sh. Apr 29 at 17:31
  • \$\begingroup\$ What do you mean by "UART pullup resistor"? A normal UART does not use a pullup resistor. \$\endgroup\$ – Elliot Alderson Apr 29 at 17:33
  • \$\begingroup\$ Do you mean I2C? \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Apr 30 at 22:13
  • \$\begingroup\$ If you connect all node's RX is not a problem, a logig level change drives all the input in the same voltage level. But you should not connect TX outputs together, they might (when they are not overload and/or short circuit protected) damage each other when they try to drive the output to opposite logic level. But at least these push-pull outputs stucks to fixed voltage, and so block the communications on the data rail. \$\endgroup\$ – Dankó Dávid Oct 11 at 21:11
  • \$\begingroup\$ Basically UART is a pheripheral and not a bus. But I'm working on a project that aims to connect microcontrollers using uart peripheral and minimal amount of cheap electical components: github.com/danko-david/uartbus. The solution works as a multi-master bus system, and at the opening readme there's a schematics that shows how to connect node to this kind of "rail with pull-ups" bus configuration. \$\endgroup\$ – Dankó Dávid Oct 11 at 21:12
3
\$\begingroup\$

UART protocol is normally used on point-to-point links, and does not define a "bus" as such.

You can use UART protocol on a bus, but you must also define an electrical interface that allows this to occur correctly. In a master-slave arrangement, the primary issue is controlling which slave drives the master's receive input. You could use an open-collector arrangment, a matrix of diodes, or some kind of active multiplexer.

\$\endgroup\$
  • 1
    \$\begingroup\$ Yes, but all of the parts in question should be able to simply tri-state their UART output pin, so no additional hardware is needed. The asker will need custom software on them anyway to implement an addressable scheme so that only the targeted device recognizes the prefix that means it is being targeted, pays attention to the rest of the message, and activates its output pin long enough to clock out the message (including the last part of the last word, not just when the transmit register becomes able to accept new data) \$\endgroup\$ – Chris Stratton Apr 29 at 17:57
1
\$\begingroup\$

Even if a slave is not transmitting, it is outputting an idle state onto the line. Therefore, if you have multiple transmitters connected to the same line they will fight each other as one tries to transmit and another tries to hold the line in idle.

The devices that are only listening and not sending need to disconnect their transmitter from the line. One way to do this is by choosing transceivers that have a TX disable signal that will put the TX disable in high impedance. If you are just using direct UART lines you can mess around with the I/O settings to put the pin in high impedance or as a dummy input which won't try to drive the line.

UART has no pull-ups. There is no output state for UART, RS-232, RS-422, or RS-485 that can be overridden. You need to go high impedance.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.