Electrical – Use half-duplex or full-duplex RS-485

rs485serialslave

I have a master microcontroller that can control 4 slave microcontrollers. Each slave microcontroller is connected to 3 sensors.

The master microcontroller asks to retrieve the value of a specific sensor on a specific slave, and the slave sends the value to the master. And so on…

Can I use the full duplex protocol ? Like this (where RO = RX and DI = TX) :

enter image description here

Is it better to use half-duplex ? When is it necessary to use half-duplex ? It implies enabling receive and driver at a specific timing which can be annoying compared to the full duplex method.

I have never used an RS-485 before so I am a beginner 🙂

Best Answer

Is it better to use half-duplex ? When is it necessary to use half-duplex ? It implies enabling receive and driver at a specific timing which can be annoying compared to the full duplex method.

It is necessary to use full-duplex when you want to transmit and receive simultaneously.

It has nothing to do with the number of slave nodes, which requires either moderation/collision avoidance mechanism on one bus or individual peer-to-peer connections between master and each slave.

It is never "necessary" to use half-duplex. The "better" part is defined mostly by the number of wires you are willing to run between the nodes.

The "annoying" part is highly exaggerated. Since in your code

... master microcontroller asks to retrieve the value of a specific sensor on a specific slave, and the slave sends the value to the master ...

you already have these two separate transmit/receive states. Adding one GPIO switch in between is trivial.

Another consequence of the method of operation quoted above is that you also have moderation mechanism defined. If slave can only respond after being prompted and only one can be prompted at a time then there is no risk of collision (unless you mess up slave address assignment, that is).

If you sum up all of the above you'd see that half-duplex communication with all the nodes on a same bus is quite sufficient for your needs. You just have to make sure that you use RS-485 compatible transceivers, like ADM3485.