RS-485 for Instrument Control: Termination, Bias and Debugging
Stripline Engineering · · 5 min read
RS-485 is the quiet workhorse of instrument and industrial control: two wires, long cables, many devices on one pair. It is also the interface that most often "almost works" on the bench and fails in the installation. Our RF power amplifiers use it for command and telemetry, and Spectra-4 has two RS-485 ports, so this note collects what actually matters when you wire it up.
Why RS-485
RS-485 is a differential standard: data is the voltage difference between two wires, A and B, so noise that couples equally onto both cancels out. That gives it three properties that single-ended serial lacks:
- Distance. Up to roughly 1200 m at low data rates, falling as the baud rate rises (around 12 m at 10 Mbit/s).
- Noise immunity. A wide common-mode range tolerates the ground offsets and interference of a real installation.
- Multi-drop. One pair can serve many devices. The standard assumes up to 32 unit loads, and modern low-load transceivers allow more.
A typical two-wire RS-485 bus is half duplex: only one device may drive the pair at a time, so the host asks and one device answers.
Topology: a line, not a star
The bus must be a single line, daisy-chained from device to device, with the shortest possible stubs. A star or a tree creates reflections at every branch. If your layout forces a branch, keep it short compared with the signal rise time, and prefer a repeater to a long stub.
Termination: both ends, and only the ends
Put a resistor equal to the cable's characteristic impedance across A and B at each physical end of the bus: typically 120 Ω for twisted-pair RS-485 cable. Not in the middle, and not at every device. Too few terminations give reflections and corrupted data at higher speeds; too many load the bus down.
At low baud rates over short cables you can often get away without termination, which is why bench tests pass and installations fail. Terminate anyway.
Bias: give the idle bus a defined state
When no one is driving, the bus floats, and a receiver may decode noise as data. A pair of bias resistors, one pulling A up and one pulling B down, holds the idle state at a valid logic level. Fit bias at one point only (usually the host), sized with the termination in mind, or use transceivers with built-in fail-safe.
Cable and grounding
- Use twisted pair, preferably shielded, with 120 Ω characteristic impedance.
- Connect the shield to ground at one end to avoid ground loops, or through a capacitor at the other if you need high-frequency screening.
- Include a common reference. RS-485 tolerates a ground offset, but only within its common-mode range of about -7 to +12 V. Where devices are far apart on different supplies, run a signal ground wire or use isolated transceivers.
Direction control
Because the bus is half duplex, the host must switch its transceiver between transmit and receive. USB-to-RS-485 adapters usually do this automatically; a microcontroller drives a direction pin, and the switch back to receive has to happen promptly after the last bit, or the first bits of the reply are lost. When a "working" bus drops the start of every response, this is the usual cause.
A debugging checklist
- Confirm the A and B wires are not swapped. Naming differs between manufacturers, and swapping them is the most common first-time fault.
- Measure the idle voltage between A and B with the host quiet. It should be a clear, defined level, not near zero.
- Check there are exactly two terminations on the bus.
- Look at the waveform on a scope. Ringing on edges means reflections; a slow, rounded edge means too much capacitance or too long a cable.
- Reduce the baud rate. If the problem disappears, it is a signal-integrity problem, not a protocol problem.
- Check each device has a unique address and the host and devices agree on baud rate, parity and stop bits.
Where it appears in our products
On an RF power amplifier the RS-485 link carries the output-level command, the protection trip points, and live readings of forward power, reverse power, supply voltage, current and temperature, so several amplifiers can share one pair. The Spectra-4 SDR platform provides two RS-485 ports and two RS-232 ports for controlling external equipment such as amplifiers, switches and positioners from the same board. Pair them and the SDR can read an amplifier's forward and reflected power without any extra instrumentation. For what the telemetry tells you, see VSWR protection in RF power amplifiers.