It’s possible to avoid many pitfalls and save on troubleshooting time by paying attention to some fundamentals when using RS-485.
The best approach is preventative. Determine a device’s communications characteristics before system design is complete and then as the right questions during system design, such as:
- Is this device configured for two-wire or four-wire systems?
- Is a signal ground connection available?
- Is the device isolated? Does it include any surge suppression devices?
- What value bias resistors, if any, are used in the device—and are they accessible for modification?
- Is the device terminated and accessible for modification?
- What is the device’s response time (turnaround delay)?
- What is the programmable address range of the device?
- What baud rate or range of baud rates is supported?
Tristate control using RTS
When you use an RS-485 converter with RTS control, set the RTS high before the data is sent. Also, set the RTS line low after the last data bit is sent.
When an RS-485 network is connected in a two-wire, multi-drop party-line mode, connect the receiver at each node to the line. Configure the receiver to get an echo of its own data transmission. This setup is desirable in some systems but troublesome in others. Check the data sheet for your converter to determine how the receiver “enable” function is connected. Check the requirements of your application software to see if it supports RTS control. If in doubt, choose a converter with Send-Data control.
Using Send-Data control
If Send-Data control is used, the converter automatically disables the transmit data line at a fixed interval after the last bit, typically one character length.
Interval length is important. If too short, you can miss parts of each character being sent. If longer than the turn-around delay of the responding devices, your system may try to switch the data line from transmit to receive before the node with the Send Data converter is ready to receive data. In the latter case, you will miss portions, even complete characters, in the response.
Is it a two-wire or four-wire system?
RS-485 systems can be either two-wire or four-wire systems. The two-wire configuration—with the additional ground conductor here—reduces cabling cost, but is restricted to half-duplex communications (cannot receive and transmit at the same time). The majority of RS-485 devices are two-wire configurations.
Devices configured for four-wire communications bring out A and B connections for both transmit and receive pairs. You can connect transmit lines to receive lines to create a two-wire configuration. The latter type device gives the most configuration flexibility.
Note: Four data wires plus an additional signal ground wire are used in a four-wire connection. The signal ground line should also be connected in the system to keep the common-mode voltage, vcm, at the receiver within a safe range If you operate the interface circuit without signal ground connection, you sacrifice reliability and noise immunity.
To terminate or not?
Termination matches impedance of a node (transmitter/receiver) to the impedance of the transmission line (cable). When impedances are mismatched, the transmitted signal is not completely absorbed by the load and a portion reflects back into the line.
Termination, however, increases load on the drivers, increases installation complexity, changes biasing requirements, and makes system modification more difficult.
Also, adding termination greatly increases power consumption and requires the network to be re-biased. Termination may not have any benefit when used at low data rates or on short runs. Termination is not recommended when using port-powered RS-232 to RS-485 converters.
If you use terminators, understand their pros and cons. You’ll need resistors of more than 90Ω. Typically, they’ll be placed only at the extreme ends of the data line. Place no more than two terminations in any system that does not use repeaters. Always recalculate the bias resistors when you add termination to a system.