Component Creation Help

Series Termination Resistance

Series Termination Resistance

by James Koerlin -
Number of replies: 9

Wow Mark, 

I am learning a lot about the little details of circuit design.  In the Circuit Analysis Book you mention the SPI lines need Series Termination Resistors.  However, I didn't see any calculations for this resistance.  I was able to find this link for calculating the STR. 

https://practicalee.com/termination/

However, it refers to a Zo which I think is the impedance of the driver.  But scouring the RP2040 docs I only found termination referencing the USB drivers.   It seems like the resistance value also depends on the resistance of the traces caring the SPI signals.  This is really starting to tax my little Mechanical Engineer's mind.   I can certainly leave these values undefined for now.  But please tell me you will cover this in a future reading.

In reply to James Koerlin

Re: Series Termination Resistance

by Mark Hughes -
Hi James!
I have good news and I have bad news. The bad news is that there are so many gotcha's in electronics engineering that you can go crazy trying to keep track of everything. The good news is that there is a lot of flexibility in most designs. If you design a circuit that has <10 ns rise time, you need to pay a little closer attention. But past that, you can likely ignore some of the tedious engineering and you'll be just fine.
Don't sweat our project -- we can design for connectivity and be just fine. But give me a ring if you're designing a single channel PAM4 112 GBPS link in FR4 :)
In reply to James Koerlin

Re: Series Termination Resistance

by Tony Booth -
I thought this was an interesting question. It has also been taxing to my little mind (physicist here rather than mechanical engineer, but in any case not electrical / electronic engineer). After quite a bit of reading I have come to the following tentative conclusions:

  1. You have a source (RPi output pin), a line (circuit trace), and a load (LED driver input pin).
  2. Imagine you are going to step the voltage at the source from 0V to 3.3V.
  3. If the impedance of the load equals the impedance of the line, the step travels down the line to the load and that is the end of the story.  But if the impedance of the load is greater than the impedance of the line (it probably is in our case) then the step will travel down the line to the load and be reflected back in a way that increases the voltage seen at the load.
  4. The reflected voltage will travel back to the source and again be reflected, depending on how well the impedance of the source is matched to the impedance of the line.  And so on.
  5. The reflection of the voltage could potentially damage an IC at either end (in the worst theoretical case you might put 6.6V into the LED driver on the first reflection).  The reflection can also cause oscillations ("ringing") that might cause unwanted changes in logic levels or noise that affects other circuit elements.
  6. If possible, you want the impedance at the load (LED driver input) to look like the characteristic impedance of the trace, probably a few tens of ohms.  This stops any reflection.  Since the input impedance of the LED driver itself is probably already much higher than 100 ohms, you can't achieve this using a series resistor.  You could use a parallel resistor to GND, or a pair of parallel resistors (one from 3.3V, one to GND), or some similar solution, but be very careful that you don't draw enough current to ground to damage the RPi.   
  7. Another solution is to make the impedance at the source look like the characteristic impedance of the trace.  The initial reflection at the load still happens, but it stops once it returns to the source (no re-reflection). The output impedance of the RPi is probably quite low, so a series resistor of a few ohms or tens of ohms might do the trick.
  8. If the line is short then all the reflections will happen very quickly because the voltages travel along the line at something like the speed of light (and they do die out because real components don't reflect 100%).  Any unusually high or low voltages will be fleeting, hopefully fleeting enough to not cause any problems.  This does depend a bit on your ICs: if they are very sensitive or designed for extremely fast signals you might still have to worry.  I found various rules of thumb for what constitutes a "short" line, and I think ours probably are but it depends on things I don't know like how fast the RPi output ramps.
  9. Some ICs have internal protection diodes which are designed to clamp input/output voltages to allowable ranges.  If the voltage at the pin goes above/below the allowable range, say because of a reflected voltage, the diodes conduct.  For an input pin, this can switch the input impedance from high to low, making a significant amount of current flow.  Putting a decent-sized resistor at the input pin can limit the current through the diodes, protecting both the diodes and the source IC (which has to provide the current).  Even in ICs without protection diodes, a series resistor might prevent damaging currents from flowing.  [Though maybe you don't want to add a big resistor unless you have already given up on matching impedance].
  10. Just browsing around, it seems that a reasonably common way to decide on an approach for impedance matching, and on component values, is actually to measure load voltages using an oscilloscope and vary things until the response to the incoming signal is acceptable.  Probably not so easy for the hobbyist!
If you are interested I found these two sources useful:
I'd be interested in what more experienced folk have to say, even if it's a bit off-topic for a PCB course!
In reply to Tony Booth

Re: Series Termination Resistance

by Henri Kemppainen -
Correct me if I'm wrong..

I think that if we don't need a very high frequency signal (as is the case in our project), then we can just use a low pass filter to slow the edges, thus making our traces electrically long w.r.t. rise/fall time (point 8). In that case, we can disregard all the theory about transmission lines and impedance matching. And a series resistor in conjunction with load capacitance can make an adequate RC filter. We just need to respect the setup & hold times. Is that right? And even if our components could withstand reflections without glitching out, we'd still want to limit the current both to keep power reasonable (push-pull outputs can source a fair bit more than we need) and to reduce EMI due to large changing currents.

On the other hand, if you actually had a high frequency signal, then a lowpass filter is not an option since it'd destroy the signal and you'd really have to treat it as a transmission line and do impedance control and appropriate impedance-matched termination.

I'm also interested in hearing what the experienced folk say. A lot of the theory on the internet jumps straight into "high speed" designs (in which case: yes, you have a transmission line) but a quick search doesn't give me much info about how to think about and deal with (potentially) fast edges on otherwise slow signals.
In reply to Henri Kemppainen

Re: Series Termination Resistance

by Henri Kemppainen -
I wanted to see what LTSpice thinks. Caveat emptor: I don't know how to use LTSpice, I don't understand how it works, and I don't know if the chosen values and the simulation are realistic. I used a 2ns transmission line, which is relatively short but still probably longer than anything anyone will make in this project. Input is a 20MHz 3.3V square wave with 5ns rise and fall times (fast but still longer than transmission line delay) with 5 ohm series resistance (this might be too low but I think it hilights the effect I want to observe).  Load is 50 megaohms with 5pF of capacitance (somewhat arbitrary but could be in the right ballpark?).

With 0.1 ohm at source, we get significant ringing. With 50 ohms, the wave looks about square. With 1k, the edges get slowed & rounded but signal still looks perfectly appropriate for the given frequency. If you replace the transmission line with a chain of (series) inductors and capacitors to ground ("lumped" element approximation of transmission line with no simulation of delay and or reflections) and make sqrt(L/C)=50 (e.g. 1pF caps and 2.5nF inductors), you will still observe very similar ringing and similar effects on the output upon changing the series resistance. FFT naturally looks quieter at higher frequencies as resistance is increased.

So I'd like to conclude that the time delay and reflections are not important for such short traces but we still want to limit current and ringing; overshoot and ringing is caused by the L and C. However, making conclusions based on simulations without really understanding them is dangerous so I'll let someone else tell me if this makes sense.

LTSpice simulation of transmission line, 0.1 ohm series resistor

LTSpice simulation of transmission line, 50 ohm series resistor

LTSpice simulation of transmission line, 1k series resistor
In reply to Henri Kemppainen

Re: Series Termination Resistance

by Henri Kemppainen -
And that was actually 200kHz (5us period) and not 20MHz input.
In reply to Henri Kemppainen

Re: Series Termination Resistance

by Tony Booth -
Man, it certainly looks like you did a lot of work Henri! Thank you.
In reply to Tony Booth

Re: Series Termination Resistance

by Henri Kemppainen -
It's an interesting topic and I couldn't quite give up just yet.

One thing I wanted to understand is whether the ringing one can observe with fast edges into an (R)LC circuit is really the same phenomenon as the reflections on a transmission line (ringing edges = reflected edges?). There are contradictory statements on the internet, so I don't want to say it is or isn't.

If we think of a (lossless) transmission line as tiny inductors and capacitors distributed across the length of the cable, then the physical mechanism by which reflection occurs at the open end (or receiver's high-Z input at the end of the trace) could be the same as in an LC circuit: the last "tiny capacitor" is charged but has nowhere to dump the energy except back towards the source, the same way the capacitor in an LC resonator dumps energy back towards the L after being charged up. I don't know if this is the right way to think about it, but at least it feels intuitive, and looks like transmission lines are often approximated (crudely) as a single LC circuit, or (less crudely but still not perfectly) as a long chain of Ls with Cs to ground. That would give credibility to the claim that LC ringing and transmission line reflections are the same phenomenon.

However, the single LC model completely disregards propagation delay, and that is why I don't like to equate it with a transmission line and its reflections. The delay is important when you talk about reflections. Depending on the length of line, you could literally see duplicate pulses appearing between the incident pulses as you observe the reflections with a scope. On a shorter line, the reflections can overlap the original pulse, giving it a stairstep edge (it can have one or more steps depending on whether the signal is reflected multiple times). This also explains why with source (series) termination you can observe a reflection at the source but the signal looks ok at the receiver (point 7 in your post above). Here are nice scope shots of a (longish) coaxial line where you can see reflections: https://web.physics.ucsb.edu/~lecturedemonstrations/Composer/Pages/76.18.html

If you make your transmission line short relative to rise/fall time (or if you approximate the transmission line as a single LC circuit), then you will not see any steps or reflected copies of the signal. All the effects related to propagation delay can be dismissed, but given suitable LC (if not from the trace itself, then from a fingertip sized board with a small inductor & capacitor on it, for sake of science) you should still see ringing which you can damp with R. This sort of gets me back to the conclusion I wanted to make in my previous post: it's best treated as an (R)LC circuit, not a transmission line.  https://en.wikipedia.org/wiki/RLC_Circuit

And the exact values of L and C (and R) aren't particularly important; just throw a resistor in there to limit current and damp that oscillation.  It's ok to overdamp as long as your square wave still looks roughly like a square wave when you squint.  If it starts to look more like shark fins (voltage at receiver rises very slowly and barely reaches peak), you might have gone too far (but with a low frequency bus you can probably get away with quite a lot!).

If you have a scope, you could do an experiment and try different resistors.  0 ohm, 22 ohm, 330 ohm, 1k, 10k, 47k.  Probe at receiver, and again at source to see if there's any sign of reflection (there probably wouldn't be unless you have a very long trace).  I'd like to see the result.  Mm, maybe I'll do it myself if I can find the time.  (Where does all the time go?  I have a habit of going down rabbit holes and then it's two in the morning and I haven't found any rabbits nor have I gotten anything done!)
In reply to Henri Kemppainen

Re: Series Termination Resistance

by Tony Booth -
The oscilloscope sounds like a good idea, just to satisfy curiosity. I'm not sure if mine is up to the task but I might give it a try once I have a PCB in hand.
In reply to Tony Booth

Re: Series Termination Resistance

by Mark Hughes -
Just an FYI -- I'm not ignoring this discussion -- in fact it's exactly the type of discussion I really get into (also a physicist). I'm just swamped at the moment.