PCIe for Hackers: The Diffpair Prelude
hackaday.com
hackaday.com
Someone handed me a non-functional prototype system a few years ago (the first time I'd encountered PCIe), and it had a local REFCLK and an upstream Android-style host which, indeed, had enabled spread-spectrum clocking. Took me two miserable weeks to figure that one out.
This is unfortunate, because for transporting video you would like to also transport the pixel clock, but you don't get it for free from the SERDES CDR.
DisplayPort use SERDES and have to transport the pixel clock. They do it by sending a message with fractional relationship between the pixel clock and the SERDES clock to the receive side, which derives the pixel clock from the recovered SERDES CDR clock using a fractional-N PLL.
I had the idea of transporting video over PCIe at one point, so I was interested in this. The reason is that PCIe is sometimes available for free, so why not use it. I wanted to use a local reference clock, so would have been forced to use the DisplayPort scheme (but no fractional-N PLL available).
SERDES with actual PLL CDRs in them for video do exist, but they are different from the generic SERDES used for PCIe and networking.
[edit: removed HDMI, only DisplayPort works as I said above]
Wrong! This is a myth that's stubbornly difficult to weed out. The coupling between the wires of a pair is only ~12% the amount of coupling to the reference plane.
On a PCB it's best to treat each signal on its own and route it as a single ended, coplanar waveguide surrounded by reference planes. This allows to use far thicker widths, which reduces inductance, which also reduces the coupling to radiating EM fields.
If you want a longer talk on the topic: https://www.youtube.com/watch?v=QG0Apol-oj0
Differential signals, at a physical layer level, are faster than single ended IO. It’s because you have double the current drive/sinking capability with two drivers. You’re also getting capacitive coupling between each leg of the pair working in your favor, which keeps your edge transition nice and fast.
Important stuff when your unit interval is under 500ps!
The article is correct. This comment is wrong.
> Differential signals, at a physical layer level, are faster than single ended IO. It’s because you have double the current drive/sinking capability with two drivers.
The load is also double in a diff pair compared to a single wire, so the net effect is a wash compared to a single wire.
> You’re also getting capacitive coupling between each leg of the pair working in your favor, which keeps your edge transition nice and fast.
The opposite is true. Differential capacitance effectively appears 2X higher than the nominal capacitance to differential signals, making it a drawback of differential signaling rather than a benefit.
In other words, the capacitance isn't doubled, since the capacitance is split by the imaginary ground between the two lines. It looks like two caps in series, not in parallel. Same is true for the load resistance.
Everything I wrote is 100% correct and in fact incontrovertible. Whether there is a little or a lot of differential capacitance does not change the fact that the differential portion of the capacitance has a 2X effect on the differential signal (as opposed to the common-mode signal, which it has no effect on). This is supported by basic math.
If capacitance is to ground then it is not differential capacitance so it is not relevant to this discussion. It may be true that differential capacitance is not a significant contributor to the impedance of PCB differential traces but that does not change the fundamental result (similarly, the principle of photovoltaic conversion still holds true in the dark even though there is little light to convert). And PCB traces are not the only kinds of differential pairs. Diff pairs exist inside the integrated circuits that drive the PCBs where they operate less like transmission lines and more like lumped capacitances due to the frequencies of interest compared to the dimensions of the conductors. In these circuit and conductor structures, differential capacitance can be significant and this is what OP was talking about since he was talking about the legs of the driver (transistors). OP was just wrong about the differential capacitance being good for speed. It's bad for speed.
You're right that differential signals work much better at high speed than single-ended! However one major reason is that you can get a much higher data rate using slower edges by comparing two signals. Diff pair signals don't look more like square waves due to more drive power - they look more like sinusoids. Which uses way less power!
I found this to be absolutely best resource on the topic for somebody with no formal electronics education like me.
With intuitive understanding you start seeing how various design choices affect the performance and you can focus on checking what might be the cause of the problem and fixing things that have biggest potential for improvement. It allows you to learn from your mistakes whereas with heuristics you feel like a dog that is being beaten by the owner but without any idea why.
Tinkering with anything physical is always going to need appropriate tools, so there is probably no better way than to find some of the tools as cheaply as possible.
PCIe seems to be a well designed standard all things considered - very fast and very robust.
USB4 is a competing, incompatible method of encapsulating and multiplexing PCIe, DisplayPort and USB data packets over one cable. But the USB4 spec incorporates Thunderbolt as an alternate mode. Thunderbolt support is required for USB4 hubs but optional for USB4 hosts and devices. So you will often (maybe even always, in practice) be able to use a USB4 host port as a Thunderbolt port.
Note also Display Port now works similarly: instead of switching to an alt-mode (dedicating half the lanes to a video signal), in USB4 Display Port packets are encapsulated in usb4 packets. So now you can attach a variety of displays, to a tree of hubs, provided you have bandwidth, whereas this was a cluster fuck for a while... it's part of the reason usb-c output hubs were so rare, no one wanted to explain to consumers why a couple monitors with usb-c cables wouldn't work with their hub. Now, they will (provided there's sufficient bandwidth).
This was true on an editorial level and on a structural level. They defined terms before they used them, they didn't use the same term to mean two different things, they foresaw and sidestepped problems that other standards blundered into, they didn't go on architecture astronaut tangents, they weren't stingy with bits when they could buy simplicity/clarity/separation of concerns but they spared no effort when performance was on the line. These were all frequent sins in the other standards.
I've always wondered what human factors led to this. Good leadership? Fewer cooks in the kitchen? More time? There is probably a lesson in there, but I didn't stay in computer engineering long enough to gain industry contacts and figure it out.
It looks like PCIe 1.0 was designed solely by Intel, which probably accounts for a lot of the coherence and editing. SATA (2003) was designed by committee.
> any interference affects the [diff pair] signals equally – as signals are compared to each other to receive information, this means that the information received is not affected by noise overlaid onto both of the signals.
This is not true - a common myth about differential pairs. Don't rely on it for your designs. More info - see page 15 https://www.speedingedge.com/PDF-Files/DiffSigDesign.pdf
I understand DC resistance. After designing and building my own Tube based electric guitar amplifier, I head to learn the relation between DC resistance and current _intimately_.
What I still didn't have a grasp on is the concept of impedance. While I was able to calculate correct values for my guitar amp, I didn't know _why_ I was doing it which is a bit frustrating. For instance, I still don't understand the output transformer that "matches the impedance of the speaker to the output tube". Le sigh.
I find amateur radio literature to be pretty good for this kind of stuff. It's a very central issue to them.
Impedance of a transmission line is weird: in some ways, it acts exactly like a resistor, and in some ways it doesn't.
In contrast to a resistor, an ideal transmission line doesn't convert electrical energy to heat. Ideally, 100% of electrical energy put in one end of the line will make it to the other end of the line intact.
However, just like an ideal resistor, an ideal transmission line will have a real-valued impedance, not a capacitive (negative imaginary values) or inductive (positive imaginary values) impedance; nor will an ideal transmission line have any frequency dependence in its impedance: 50 ohms is 50 ohms.
One way I like to think of characteristic impedance is that it's the temporary impedance a change in signal will see until current/voltage wave reflections make it back from the other end:
For a 50-ohm ideal transmission line one light-second long (pretending we have velocity factor 1.0 to make the math easy), your ohmmeter would read 50 ohms for two seconds, and after that it would read whatever resistance is connected to the other end. If the other end is an open circuit, the ohmmeter would measure 50 ohms then infinite resistance; if the other end is a short circuit, the ohmmeter would see 50 ohms then 0 ohms; if the other end is terminated with a 50-ohm resistor, the ohmmeter would measure 50 ohms indefinitely.
If you have an infinitely long ideal transmission line with 50 ohm impedance, and hooked up an ohmmeter to it, it would measure 50 ohms. If you hooked up an LCR meter, it would show 0 impedance and 0 capacitance.
This indistinguishability between an infinitely long transmission line and a resistor is why a matched termination resistor prevents signal reflections: If you have some finite length of transmission line, and you attach either a matched resistor or an infinitely long transmission line with the same impedance to the end, the first length of transmission line cannot tell which you have attached - its behavior will be the same in either case: all the energy is passed into the next section.
https://pediaa.com/difference-between-impedance-and-resistan...
In audio, it's about the equivalent resistance of an input or load. If you put a dummy resistor in place of a load, how would the output/driver treat it? How do you choose what value of resistor to use, to stand in for a given load/input? That's the impedance.
In RF, it's about the equivalent resistance of the transmission line itself, because at high enough frequencies the speed-of-light prevents you from even seeing the far end. That phenomenon is well treated here:
https://www.ibiblio.org/kuphaldt/electricCircuits/AC/AC_14.h...
There's a lot of inter-layered things behind "why do tube amps need an output transformer." The concept of impedance is pretty simple and doesn't really deal with that, other than being the 0th layer.
I'd like an external GPU for a high-end laptop with no compromises.