Electrical – Why lines A and B are HIGH when idle (rs485)

modbusrs485

I'm using modbus RTU over RS485 for a project.
I use a RaspberryPI as master and Arduino Pro Mini as slaves.

My problem is the following :
I plug a sensors on the bus and it returs its value.
I plug another sensor, this one returns its value but the first sensor doesn't return its value anymore.
So it looks evident something makes them incompatible.

I tried to diagnose it using a logic analyser and the results are the following :
When idle, the lines A and B from the master are respectively HIGH and LOW.
When idle, the lines A and B from the slave are both HIGH.

I wonder if the line B shouldn't be LOW..
Looking why this line was HIGH, I discovered that the line is pulled HIGH because of the library I use on Arduino. This library pulls DE and RE HIGH when transmitting data, LOW otherwise.
(On the max485 module, I tied DE and RE together. I'm not sure it's a good practice)

Here is the library I use on arduino :
https://platformio.org/lib/show/1727/ModbusSerial

Here is a schema of a modbus slave module :
enter image description here

EDIT :

On logic analyser (1 slave connected to the master) :

I tried with 2 differents usb/rs485 transceivers

Transceiver 1 – 3 seconds record
enter image description here

Transceiver 1 – Zoom on request / response
enter image description here

Transceiver 2 – 3 seconds record
enter image description here

Transceiver 2 – Zoom on request / response
enter image description here

So my question is: Is it normal to get HIGH on both lines A and B ?
And if not, what can I do to correct it ?

Thanks in advance !!

Best Answer

When idle, the lines A and B from the master are respectively HIGH and LOW.

That's because the RS485 interface is outputting an idle condition i.e. B is the inverse of A because the transmitter is enabled.

When idle, the lines A and B from the slave are both HIGH.

This is because the slave is set to receive data and the RS485 chip has no control on the lines . External pull-ups are the likely cause of this.

If master and slave were connected then master (although being in idle) would drive the line high and low and, you would see high and low at the slave.