Knowing that I need to refine my RS485 circuitry, I've been reading. I have a series of specific questions and I hope that you'll indulge me as I describe how I attempted to follow through an application note.
Here are some basics of the serial comm system:
- 115.2 kbaud, mainly limited by the microcontrollers
- Half-duplex (1 differential pair plus ground)
- Worst-case beginning-to-end cable run of ~80m
- Worst-case stub length of maybe 2cm due to the PCB traces; no cable stubs
- Multipoint device count of typically 8, probably no more than 20
- Some, but not much, BER tolerance due to checksum in signalling protocol
- All slave devices are SN65176; the master is a USPTL4.
Assume the cable I use is Belden 3106A, because it's well-specified:
- Characteristic impedance Zo = 120 ohm
- Velocity of propagation VP = 78%
My termination circuit has gone through a few iterations:
- Simple bidirectional parallel termination. Doesn't work whatsoever, due to breaking failsafe operation and producing spurious start bits.
- Bidirectional termination with the master side having simple parallel termination and the last slave having a circuit as described in AN-903 "Power Termination". Still doesn't work whatsoever: the parallel termination at the master presents too much of a DC load on the master and breaks failsafe operation.
- Unterminated master, last slave terminated with "power termination". It looks like this:
It works, but is non-ideal for at least two reasons: there is still a lot of DC load; and the master side is not impedance-matched/terminated.
For a better alternative, I consider TI AN-903 "A Comparison of Differential Termination Techniques". Based on section 2 "Unterminated",
Low speed is generally characterized to be either signaling rates below 200 kbits/sec or when the cable delay (the time required for an electrical signal to transverse the cable) is substantially shorter than the bit width (unit interval) or when the signal rise time is more than four times the one way propagation delay of the cable (that is, not a transmission line).
Since 115.2kbaud < 200kbaud, the first criterion is met. For the second criterion, to calculate the cable delay:
(80 m) / 0.78c = 342 ns
Compared to the bit width:
1 / 115.2kbaud = 8.68 μs
So this criterion is also easily met. This means that I could potentially treat the cable as not being a transmission line, and not needing impedance matching / termination. However, I want to develop a termination circuit regardless, for the following reasons:
- It can be done cheaply
- It's a learning opportunity
- It increases transmission quality, even if it isn't by much
- In case the cable run ever needs to be greatly lengthened, the system will survive
- The TI specsheet unconditionally recommends it:
The line should be terminated at both ends in its characteristic impedance RT = ZO. Stub lengths off the main line should be kept as short as possible.
I want to pursue a modified version of section 5, AC termination. Given my system parameters, RT = 120 ohm. For CT, the app note says:
CT, on the other hand, is selected to be equal to the round trip delay of the cable divided by the cable's ZO. CT ≤ (Cable round trip delay) / ZO
Round-trip cable delay = 2 * 342 ns = 684 ns
CT ≤ 684 ns / 120 ohm
CT ≤ 5.7 nF
Select CT = 5.6 nF, the closest capacitance in the E24 (5%) series.
The app note also says:
Further, the resulting RC time constant should be less than or equal to 10% of the unit interval (TUI).
(120 ohm)(5.6 nF) ≤ 0.1 * 8.68 μs
672 ns ≤ 868 ns
So this capacitor looks OK. However, I see a (big?) problem that is not mentioned in the app note. The capacitor inline with the matching resistor makes the impedance of the matching network very unequal to the characteristic impedance of the cable.
f = 115.2kbaud / 2 = 57.6 kHz
120 ohm + 1/2πj/57.6kHz/5.6nF = 120 + 493j ohm
Should I not also add a series inductor to cancel that reactance?
493 ohm / 2π / 57.6kHz = 1.36 mH
Use the E24 value 1.3 mH. Then:
120 ohm + 1/2πj/57.6kHz/5.6nF + 2πj*57.6kHz*1.3mH = 120 - 22.9 ohm
That reactance can be brought much closer to zero with more precise inductance.
When I simulate a transmission line with the same characteristics as the Belden, and bidirectional RC AC termination, it appears to work quite well. However, if I add the inductor to cancel the capacitive reactance, there's horrible ringing.
Given all of the above, my questions are:
- Is my math, and my interpretation of the application note, correct?
- Why does the AN not show bi-directional AC termination? Is it valid to have AC termination on both ends of a multi-point line?
- Why does the AN not take into account capacitive reactance when describing AC termination?
- The PC-side RS-485 transceiver has a non-removable 4.7k pullup on line A and a 4.7k pulldown on line B, for fail-safe operation. Would this be compatible with AC termination right next to it?