3
\$\begingroup\$

I am going to connect several micro-controllers together using half-duplex RS485, but there is no absolute master or slave, each micro must be able to communicate others and this will cause problems if both of them want to send data at the same time (one makes A high and B low and the other makes A Low and B high, that will cause short circuit) so I am thinking of adding pull-up and pull-down resistors to the lines and send data by changing state of TxEn pin instead of TxDt pin of RS485 ICs.

Here is my problem:

  • Pull-up, pull-down and EOL resistors form a voltage divider on the RS485 data lines, does it make data communication problems?
  • What happens if I ignore EOL resistors and just apply pull-ups and pull-downs at both ends?
  • Is there any relation between maximum cable length and resistors value?
  • Does using higher data voltage increases the data transmission reliability? If yes, is there any 12V RS485 ICs? (12V is the absolute maximum ratings of MAX485 and LTC1685, what about safety factor?)

BTW, if I have two 100ohm EOL resistors and 5V data voltage it means that communication consumes 100mA, that is too high for a device that consumes only 5mA, and it makes the devices to have a big voltage regulator and capacitors in comparison with other components! enter image description here
^^^ A diagram I found in LTC1685 datasheet ^^^

\$\endgroup\$

3 Answers 3

4
\$\begingroup\$

What you're suggesting is not necessarily a bad idea, but it won't work with RS485 drivers. RS485 is impedance matched; that means that the driver can be seen as a perfect driver followed by a resistor, which has approximately the same resistance as the termination resistor (exactly the same in the ideal case). Therefore, if you'd add a pullup strong enough to overcome the termination resistor, the driver would never be able to pull it down far enough. The good news of this is though that two "shorted" RS485 drivers should not cause any damage, because of the "built-in" resistor (it's probably not actually a resistor but some kind of current source; the result is the same).

Even if it would work, you'd lose all the benefits of having an impedance-matched transmission line. You might as well drop the RS485 driver at all then and just use the microcontroller pins with some pullup in the order of 1kOhm. Incidentally, this is exactly what's done in I2C. It sounds to me like that protocol might suit your needs better, if you're not interested in long (>1m or so) communication lines. If you are, you should use the RS485 transceivers as they were intended, or you probably won't get the results you're looking for.

To answer the specific questions:

  • Pull-up, pull-down and EOL resistors form a voltage divider on the RS485 data lines, does it make data communication problems?

    Yes, as explained above.

  • What happens if I ignore EOL resistors and just apply pull-ups and pull-downs at both ends?

    That would "work" if the resistors are large enough to have the drivers overcome them, and small enough to not make communication to slow (see next answer). I put that in quotes because you're losing the impedance-matched property, which means you'll get reflections in the data lines. If you transmit slow enough and/or your cable is short enough this won't be an issue, but then you may as well use something else like I2c.

  • Is there any relation between maximum cable length and resistors value?

    Yes, though it's hard to give numbers without a lot more information. Basically, the parasitic capacitance of the cable forms an RC lowpass filter with the pullup/pulldown resistor. Thus, the lower the resistance gets, the faster it will be, but the more current it will use. The cable capacitance depends on the cable buildup but is linear with its the length, so the longer the cable, the slower it will be.

  • Does using higher data voltage increases the data transmission reliability? If yes, is there any 12V RS485 ICs? (12V is the absolute maximum ratings of MAX485 and LTC1685, what about safety factor?)

    If noise margin is the biggest problem, then yes. For RS485 noise should not be all that significant though because it's differential: as long as you use a twisted pair, noise should couple in similarly for both lines, making it cancel out. I don't know the answer to the followup question, but I don't think that will be a thing: if the voltage is higher, it will also use more current with the same termination resistors, which are standardized.

  • BTW, if I have two 100ohm EOL resistors and 5V data voltage it means that communication consumes 100mA, that is too high for a device that consumes only 5mA, and it makes the devices to have a big voltage regulator and capacitors in comparison with other components!

    Ever wonder why network switches and modems run so hot? Unfortunately, this is the cost of being able to drive long transmission lines properly.

\$\endgroup\$
1
  • 3
    \$\begingroup\$ Thanks, I used I2C before, and the noise and data loss in long distances (about 25m) forced me to try RS485. \$\endgroup\$
    – Vahid
    Commented Feb 7, 2017 at 12:15
4
\$\begingroup\$

The EOL resistors are required only for the end to end devices in the RS485 network do not use it for in between nodes.

The pull up/down will load the network and add stress to RS485 drivers, try use token passing methods to transfer the master mode (transmitter) between devices

if the nodes are far apart much exposed to environment use this document to protect your network

\$\endgroup\$
3
\$\begingroup\$

RS-485 transceivers have the necessary overload protection to handle other transmitters being active at the same time. However, the protocol that you're running of top must be able to detect and handle such conflicts. (To summarize, check that what you receive is the same what you're sending. Many multi-master buses such as CAN or I²C usually handle this in hardware.)

The value of the termination resistors is not determined by the cable length but by the cable's characteristic impedance. (Here, 150 || (330 + 330) 122 ≈ 150.) If you omit them, you get reflections of your signal edges, and you can use only very low data rates.

The pull-up/-down resistors are often called "fail-safe resistors"; their purpose is to get a specific bus state even when no transmitter is active. You do not actually need them if all receivers have a built-in failsafe circuit (the LTC1685 has it), but then you are not as resistant against noise.

The RS-485 specification defines the driver's output current and voltage; transmitting 12 V is not allowed. (The transceivers don't actually output the full VCC to the bus, but a high current is the price you have to pay for reliable communication over long distances in noisy environments.)

\$\endgroup\$
1
  • \$\begingroup\$ The effective termination resistance actually is 150 || (330 + 330) = 122.2 ohms. \$\endgroup\$ Commented Feb 6, 2017 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.