PCIe for Hackers: The Diffpair Prelude
owl writes:
https://hackaday.com/2023/03/14/pcie-for-hackers-the-diffpair-prelude/
PCIe, also known as PCI-Express, is a highly powerful interface. So let's see what it takes to hack on something that powerful. PCIe is be a bit intimidating at first, however it is reasonably simple to start building PCIe stuff, and the interface is quite resilient for hobbyist-level technology. There will come a time when we want to use a PCIe chip in our designs, or perhaps, make use of the PCIe connection available on a certain Compute Module, and it's good to make sure that we're ready for that.
PCIe is everywhere now. Every modern computer has a bunch of PCIe devices performing crucial functions, and even iPhones use PCIe internally to connect the CPU with the flash and WiFi chips. You can get all kinds of PCIe devices: Ethernet controllers, high-throughput WiFi cards, graphics, and all the cheap NVMe drives that gladly provide you with heaps of storage when connected over PCIe. If you're hacking on a laptop or a single-board computer and you'd like to add a PCIe device, you can get some PCIe from one of the PCIe-carrying sockets, or just tap into an existing PCIe link if there's no socket to connect to. It's been two decades since we've started getting PCIe devices - now, PCIe is on its 5.0 revision, and it's clear that it's here to stay.
PCIe is a point-to-point bus that connect two devices together - as opposed to PCI, an older bus, that could connect a chain of devices on your mainboard. One side of a PCIe link is a device, and another is a host. For instance, in a laptop, your CPU will have multiple PCIe ports - some used to connect the GPU, some used to connect a WiFi card, some used for Ethernet, and some used for a NVMe drive.
Each PCIe link consists of at least three differential pairs - one is a 100 MHz clock, REFCLK, that is (almost) always required for a link, and two pairs that form a PCIe lane - one for transmit and another for receive. This is an x link - you can also have 2x, 4x, 8x and 16x links, with four, eight sixteen and thirty-two differential pairs respectively, plus, again, REFCLK. The wider the link, the higher its throughput!
Read more of this story at SoylentNews.