Go Down

Topic: RS485 why? (Read 1 time) previous topic - next topic

C4m4l340

Hi guys!
In my project i use 3 arduinos to communicate over RS485.
I am still at prototype, but o got an issue wich i solved, and dont undestand why.

1 master 2 slaves.
i am using those RS485 modules sold everywhere for arduinio.

The behaviour before:
Master sends message to slave 1 and receive wrong response.
Master sends message to slave 2 and receive wrong response.

After some trial and error, i discovered that if i connect the A to +, using a resitor
and B to - using other resistor, i got the system talk fine.

My question is: Why do i need to connect A and B to + and - can some one explain me?
Looking at module diagram, this connections are already made.

I used 220ohm resistors. (were the ones i had at hand)

Thanks

tkbyd


Mikeb1970

Hello,

I'm not an expert about RS485 networks, but I do know that typically you will need a resistor if you network things, so certain parts of your circuit will not be floating and are pulled down to provide a 0.
Here is a video that explain RS485 networking pretty good, in my humble opinion.
https://www.youtube.com/watch?v=VhzjYecxiSg

I hope this helps you to be successful in your project,

with regards,

Mike

ron_sutherland

Gammon's electrical connection example (see link from post #2) shows 680 Ohms between A and +5V and another 680 Ohms between B and 0V (or GND). These will pull the lines into a defined voltage should the DE pins all be disabled. If you don't force the lines into a defined range then some of the receivers (on the transceivers) will see a HIGH while others see a LOW, and noise will cause gibberish to show up on the RO pin of the transceiver.

Those resistors become a problem as the network grows. Some newer transceivers (e.g. ISL3172) have reduced that undefined range so it is possible to use twisted pair terminations alone and retain a clean RO output but all transceivers have to have the reduced undefined range (look for "failsafe biasing" info in the datasheet).

@Mikeb1970 that video seems good to me also.

Watcher

For multiple RS485 devices on the same bus I use MAX3085 which supports upto 256 devices.
However I have also successfully used the cheaper MAX485. Tested with upto 10 devices with no problems.

Pull up and Pull down resistors are needed as a fail-safe measure to make sure the bus lines are always at a defined state (voltage). Adding more devices in the network means that this resistors are effectively connected in parallel, so I use higher resistor values to compensate this. I use 47k-100k resistors.
In addition I use a termination resistor to much the transmission line impedance. In my case, I use CAT5E cabling which means I am using a 120 Ohm termination resistor .





C4m4l340

Thanks. Good links to study.
The modules i am using are these .
They already have the 3 resistors for fail-safe.

Could this be a problem using 3 modules?
All of them have the resistors between A and B which are normally used only on termination nodes.

I am
At this time, i have all on breadboard, bus included.

Watcher

#6
Dec 06, 2017, 01:02 pm Last Edit: Dec 06, 2017, 01:04 pm by Watcher
Thanks. Good links to study.
The modules i am using are these .
They already have the 3 resistors for fail-safe.

Could this be a problem using 3 modules?
All of them have the resistors between A and B which are normally used only on termination nodes.

From what I can see in the picture (!) the fail safe resistors are 10k each .If you are using only three modules on the bus, there should be a problem.
PS: Fail safe resistors are just two, not three. The third one between A-B must be the termination resistor in the order of a few 50-200 Ohms depending on your transmission line.

MarkT

RS485 assumes 120 ohms, I don't think many RS485 drivers could handle a 50 ohm load for instance, and
I don't know of any balanced transmission line that low an impedance.  Use twisted pair, use 120 ohms.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Watcher

#8
Dec 06, 2017, 02:33 pm Last Edit: Dec 06, 2017, 02:35 pm by Watcher
I use cat5e and also use 120 ohm termination ..


Edit:it looks like an 120 ohm resistor is already present on the pcb module of the picture!

MarkT

So it can only go at the end of a cable run...
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

6v6gt


Watcher

So it can only go at the end of a cable run...
Yes, provided that the devices are connected in a daisy chain topology. If they are connected in a star topology, all resistor can be left in place.

ron_sutherland

I think a Star topology needs a divider network to match the characteristic impedance of each of the connected pairs. If those boards each have a 120 Ohm then the one in the center could be removed (tombstone).   

Consider the chance that two transceivers have their driver enabled but one drives its A-line HIGH and the other drives its A-line LOW, that would be a crowbar. I sort of think the better transceivers have a current limit. The setup I use does not crowbar, it does seem to drive 50 Ohm's fine. I have an idea that the transceiver can drive a dead short all day and even take a crowbar condition without self-destructing (I'm not going to test that idea, it is just an idea).

MarkT

I suspect they all have current limiting and probably thermal shutdown, its just that you wouldn't expect reliable
communication if you don't stick to the rules.  An RS485 network with 120 ohms load at each end is of
cours a 60 ohms load to any driver, which they are designed for.

A network that was 50 ohms in each direction would be a 25 ohms load, which as I've said I'd not expect
to work.  On many microcontroller boards the RS485 driver can be one of the hottest components along
with the regulators.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Watcher

#14
Dec 07, 2017, 06:55 am Last Edit: Dec 07, 2017, 06:58 am by Watcher
RS485 chips that are designed to cope with multiple transceivers on the bus can handle "crowbar" situations without giving their smoke, even though you would normally have only one device driving the bus (talking) at any given time and the others are just listening. (One master, multiple slaves). This might not be the case with MAX485 which is probably what the module in the picture has.

Having said that,
i am using an extensive RS485 bus network over cat5e cabling with about 50 transceivers in a mixed daisy-chain and star topology without any distinct master-slave relationship.  Any device can talk at any moment to the bus (addressing takes care of packet destination) and the only method used to avoid congestion is that it first listens to check if the bus is busy before transmitting. If the bus is congested, transmission is delayed. There are still situations that more than one device is talking (e.g in cases of broadcast) and while the result is undefined, if the packet doesn't reach its destination, it is re-transmitted. All devices are terminated with 120 ohms resistors irrespective of their location which can change over time.

The above running at 9600bps operates very reliably for years now and its being continually extended.

As a side note, 2 pairs of the cat5e cable are also used to curry the required power supply for the devices. (24V DC)

Go Up