Saturday, October 10, 2009

Multidrop network for RS232

I got a requirement to communicate one master device and eight slave devices. I intended to use RS485 half-duplex communication for this system but all devices happened to have only RS232 interfaces. RS232 communication is a sort of communication that is to be used for one-to-one system. There is no problem if only the master device transmits and all slaves are receiving. The problem is that transmit lines of the slaves cannot be disabled and so that they cannot connect to the same line. After analyzing the voltage signals, I have got an alternative solution to this problem. By adding a diode to the transmit line of each slave, I can use the system just like RS485 half-duplex communication. See the following figure for the hardware connection.


Updated: 2017 Sep 02
Thanks for all your comments. I have added more configurations according to your comments.

RS232 network with multiple masters and multiple slaves



UART/TTL-Serial network with single master and multiple slaves

If you are not using RS232 transceivers to change the physical signal voltages, the outputs of UARTs are still TTL level signals. In this case, you can connect multiple UARTs to a single master as follow.



UART/TTL-Serial network with multiple masters and multiple slaves



15 comments:

  1. so pretty much the master will never kno about any Rx data as the diodes will be blocking the signal but my question is why? if what we want is a master to many slaves then software handles this already so why wud slave send anything when is not programmed to do so?

    also i like the approach but how do we go about addressing each Arduino "Slave/Rx" individually?
    me sending this block via serial from master "PC" 'LT2|LP3|LM5|LR4|LI6 clearly is meant for a specific slave mcu while other block being tx shortly after the first may look like this 'RT2RP3RM5RR4RI6' and so on and this are just for addressing which pin on that particular slave and speed of actuation after this i want to send direction/coordinates to desire location,

    ReplyDelete
  2. can you reply here ? i forgot to check the notify me check box

    ReplyDelete
    Replies
    1. We need to put diodes because you cannot short circuit many output lines to a single wire line. But there is no problem in connecting many RX lines to a single wire line.

      Delete
    2. thank you and i understand tho what about the addressing issue of each mcu?

      Delete
    3. In my case, master send a request message that contains a slave address. And only the slave with correct address responds. That means communication is always initiated by the master.

      Delete
    4. can you demonstrate a example of this approach Yan? im sorta new to this protocol of communication

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Hi, this multidrop network solution works through a TTL (UART) port?. I need to connect many arduinos modules as a Master-Salve.

    ReplyDelete
    Replies
    1. No, it won't work for TTL logic output. For that, you need a pull up resistor at RX of master (blue), and reverse all diodes (connect anodes to the resistor).

      Delete
    2. I got it. I found a post with this image:

      https://forum.poppy-project.org/uploads/default/original/2X/7/76419c9d41163af84d2e8226c22342d2c874aa4a.png

      If Vcc = 5v (arduino), R1 should be 10k, or 1M ohm?

      Thanks.

      Delete
  5. Hi Yan, I have another problem about RS 232 Multidrop Network.
    I have an Arduino MCU with a TTL converter an RS232 and a PC (RS232). Both must communicate with an RS232 sensor.

    I can use the same scheme but with two masters (Arduino and PC) ?.

    Master do not communicate with the sensor at the same time.

    I hope you can help me

    ReplyDelete
    Replies
    1. Hi El Bananero, for that case, you can add diodes to the transmit lines of masters in a similar manner which are connected in transmit lines of slaves. I have modified the post and added a new Figure for it. Please have a look at the modified post. Good luck!

      Delete
  6. Hi Yan,
    Please, how long cables did you use?
    Thanks Cenda

    ReplyDelete

Comments are moderated and don't be surprised if your comment does not appear promptly.