Creating RS-485 network with atmel mcu's

Thread Starter

Zotto

Joined Mar 3, 2016
45
Treat each node/device as being independent, regardless of whether it is a master or slave.
Each device connects to the network cable via a short stub (no more than 10 inches or there about) to the A and B lines. The exception is the device at each end of the line. That is, the two ends of the line will be terminated with a proper terminating resistor.

Each device will have its own MAX485, that is, consider each daughter board as one independent device. Each MCU will control its own DE/RE.

I don't have the recommended values here with me but for such a short run (3 feet or less), 330Ω terminators will do. For now, use 1kΩ pullup and pulldown resistors.

For such a short run, why do you need RS-485?

You can connect all TX and RX UART lines together to form a single party line provided each MCU is able to disable its TX driver.
Sorry could you explain why I would need 330Ω terminators instead of 120Ω?
 

MrChips

Joined Oct 2, 2009
34,900
Why do we need cable terminators?

The purpose of terminators is to reduce reflections on the cable. The resistance of the terminator resistor to be used should match the characteristic impedance of the cable. Hence it depends on the cable used.

Typical twisted pair cables have impedances from 100Ω to 300Ω. The more closely you match the impedance the lower the reflections.

The severity of reflections encountered also depends on the rise and fall times of the signal and on the length of the cable. The transmission speed of the signal is approximately 5ns/m. Thus, if your cable is less than 1m long and your signal rise and fall times are longer than 5ns reflections will not be noticeable. In such cases, the value of the termination resistor is not so critical.

Line drivers such as RS-232 and RS-485 drivers intentionally stretch out the rise and fall times in order to reduce reflections.
 

MrChips

Joined Oct 2, 2009
34,900
Be aware that some documentation have the A and B labels reversed.

Here is an example of how an RS-485 network should be wired.

upload_2017-7-7_12-21-57.jpeg
 

Thread Starter

Zotto

Joined Mar 3, 2016
45
Be aware that some documentation have the A and B labels reversed.

Here is an example of how an RS-485 network should be wired.

View attachment 130521
Hmm that makes, sense. Im still confused how I would calculate what value I would need. From my understanding 120 ohms is usually chosen, because the terminators are essentially in parallel, giving an impedance of ~60 ohms, which matches closely to the characteristic impedance of the line (which is usually 50 ohms?). Am i understanding that correctly?
 

MrChips

Joined Oct 2, 2009
34,900
No. You don't calculate the characteristic impedance. You look up the specs of the cable.
No. You don't calculate the two terminator resistors in parallel.

What cable are you using?
What is the maximum length of the cable, end to end?
 

Thread Starter

Zotto

Joined Mar 3, 2016
45
I haven't chosen a cable yet, which I assume is problematic to this issue. I was thinking about using standard 22-24 AWG wire to connect the breakout PCB's, then using copper traces on the actual PCB. Is this the wrong approach?
 

MrChips

Joined Oct 2, 2009
34,900
I know that you have already stated that the longest run is 1-2 feet.

RS-485 may be unnecessary. However, if you insist, PCB copper traces and twisted pair wiring will work.
100Ω to 1000Ω termination will work.
Leave out the termination and it will still work.
Leave out the bias resistors and it will still work.

Will it work at 1000m? Maybe not.
 

Thread Starter

Zotto

Joined Mar 3, 2016
45
Hey @MrChips, I am trying to figure out the inter PCB connectors that I should use. From each board I am going to have A, B, GND, and drive enable from the max485 IC. I am thinking about using rj45 connectors, because they are cheap and literally everywhere. Do you know if I could use a jack rated for cat3 and plug in a cat5 cable? I am not using Ethernet so the specs shouldn't matter, but I can't find any information if the pinouts have changed between each generation.

Do you have any other suggestions in terms of cable/connectors I could use. Thanks!
 

MrChips

Joined Oct 2, 2009
34,900
Hey @MrChips, I am trying to figure out the inter PCB connectors that I should use. From each board I am going to have A, B, GND, and drive enable from the max485 IC. I am thinking about using rj45 connectors, because they are cheap and literally everywhere. Do you know if I could use a jack rated for cat3 and plug in a cat5 cable? I am not using Ethernet so the specs shouldn't matter, but I can't find any information if the pinouts have changed between each generation.

Do you have any other suggestions in terms of cable/connectors I could use. Thanks!
The connector is not so important as the cable, as long as the cable mates with the connector.
Pay attention to the cable first. CAT5 cable has four twisted pairs when all you need is one. CAT5 cable is meant to plug into RJ45 connector which has 8 contacts. RJ11 has 6 contacts.
 
Top