DisplayPort: Tapping The Altmode

Really, the most modern implementation of DisplayPort is the USB-C DisplayPort altmode, synonymous with “video over USB-C”, and we’d miss out if I were to skip it. Incidentally, our last two articles about talking USB-PD have given a few people a cool new toy to play with – people have commented on the articles, reached out to me for debugging help, and I’ve even seen people build the FUSB302B into their projects! Hot on the heels of that achievement, let’s reach further and conquer one more USB-C feature – one that isn’t yet openly available for us to hack on, even though it deserves to be.

For our long-time readers, it’s no surprise to see mundane capabilities denied to hackers. By now, we all know that many laptops and phones let you get a DisplayPort connection out of a USB-C port. Given that the USB-C specifications are openly available, and we’ve previously implemented a PD sink using those specifications, you’d expect that we could do DisplayPort with the same ease. Yet, the DisplayPort altmode specification is behind a VESA membership paywall, with a hefty pricetag – a practice of theirs that has been widely criticized, counter to their purpose as a standards organization and having resulted in some of their standards failing.

Not to worry, however – we can easily find an assortment of PDFs giving a high-level overview and some details of the DisplayPort altmode, and here’s my favorite! I also have a device running MicroPython with a FUSB302 chip connected, and a few DisplayPort altmode devices of mine that I can disassemble. This, turns out, is more than enough for us to reverse-engineer our way into an open-source DisplayPort altmode library!

Continue reading “DisplayPort: Tapping The Altmode”

PCIe For Hackers: An M.2 Card Journey

I’ve designed a few M.2 adapters for my own and my friends’ use, and having found those designs online, people have asked me for custom-made adapters. One of these requests is quite specific – an adapter that adds one more PCIe link to an E-key M.2 slot, the kind of slot you will see used in laptops for WiFi cards.

See, the M.2 specification allows two separate PCIe links connected to the E-key slot; however, no WiFi cards use this apart from some really old WiGig-capable ones, and manufacturers have long given up on connecting a second link. Nevertheless, there are some cards like the Google Coral M.2 E-key dual AI accelerator and the recently announced uSDR, that do indeed require the second link – otherwise, only half of their capacity is available.

It’s not clear why both Google and WaveletSDR designed for a dual-link E-key socket, since those are a rare occurrence; for the Google card, there are plenty of people complaining that the board they bought just doesn’t fully work. In theory, all you need to do to help such a situation, is getting a second PCIe link from somewhere, then wiring it up to the socket – and a perfect way to do it is to get a PCIe switch chip. You will lose out on some bandwidth because the uplink PCIe connection of the switch can only go so fast; for things like this AI accelerator, it’s not much of a problem since the main point is to get the second device accessible. For the aforementioned SDR, it might turn out useless, or you might win some but lose some – can’t know until you try! Continue reading “PCIe For Hackers: An M.2 Card Journey”

Crab Shells Massively Improve Zinc-Ion Batteries

In the fast-moving world of battery research, scientists are constantly on the lookout for innovative materials with the right properties to help improve energy storage. Meanwhile, batteries are in greater demand than ever as production of EVs and renewable energy projects ramp up to new heights.

In the hunt for new and better battery materials, scientists found an unexpected hero: crab shells.Researchers at the University of Maryland have uncovered a remarkable breakthrough by exploring their use in battery production.

Continue reading “Crab Shells Massively Improve Zinc-Ion Batteries”

DisplayPort: Under The Hood

Last time, we looked at all the things that make DisplayPort unique for its users. What about the things that make it unique for hackers? Let’s get into all the ways that DisplayPort can serve you on your modern tech wrangling adventures.

You Are Watching The AUX Channel

With DisplayPort, the I2C bus we’ve always seen come bundled with VGA, DVI and HDMI, is no more – it’s been replaced by the AUX bus. AUX is a 1 MHz bidirectional diffpair – just a bit too complex for a cheap logic analyzer, though, possibly, something you could wrangle with the RP2040’s PIOs. Hacking thoughts aside, it’s a transparent replacement for I2C, so that software doesn’t have to be rewritten – for instance, it usually does I2C device passthrough over AUX, so that EDID data can still be stored in a separate EEPROM chip on the monitor or eDP LCD panel.

AUX isn’t just a differential bus, it’s more pseudodifferential, like USB2 – for instance, AUX_P and AUX_N are used separately, with a combination of 1 MΩ and 100 kΩ pullups and pulldowns signaling different states of the physical connection – for instance, a pullup on AUX+ and a pulldown on AUX- means that an external device has been connected. If you’d like to learn which combination of resistors means what, you can find in the DisplayPort specification, which isn’t distributed openly but isn’t hard to come by, either.

Also, DisplayPort link training happens over AUX, and in order to facilitate that, a piece of DisplayPort controller’s external memory is usually exposed over the AUX channel, through a mechanism that’s called DPCD. If you dig a bit, using “DPCD” as the keyword, you can easily reach into the lower-level details of your DisplayPort connection. Some of the DPCD memory map is static, and some parts are FIFOs you can funnel data into, or out of. You can find a wide variety of documents online which describe the DPCD structure – for now, here’s a piece of Bash that works on Linux graphics drivers for AMD and Intel, and will show you you the first 16 bytes of DPCD:

# sudo dd if=/dev/drm_dp_aux0 bs=1 skip=256 count=16 |xxd
00000000: 0084 0000 0000 0000 0108 0000 0000 0000 ................
[...]

In particular, the 4th nibble (digit) here describes the amount of lanes for the DisplayPort link established – as you can see, my laptop uses a four-lane link. Also, the /dev/drm_dp_aux0 path might need to be adjusted for your device. In case you ever want to debug your DP link, having direct access to the DPCD memory space like this might help you quite a bit! For now, let’s move onto other practical aspects. Continue reading “DisplayPort: Under The Hood”

Keeping Thermal Plants Cool Without Breaking The Cooling Water Budget

Steam generators in thermal (steam-cycle) power plants require a constant influx of cool water to maximize the transfer of thermal energy. How this water is cooled again in the condensor after much of the steam’s thermal energy has been spent in the steam turbines or heat exchangers is a very important consideration in the design and construction of these plants. The most obvious and straightforward system is direct “once-through” cooling, where the water is drawn straight from a nearby river or other body of water and released after passing through the condenser. This type of system is by far the cheapest, but is also impacted by both the seasons and environmental considerations.

Where cool surface water is less abundantly available, evaporative cooling in a recirculating system such as with spray ponds and cooling towers is a good alternative. Although slightly more costly, a big benefit of these is that they require far less water and have much more control over the intake water temperature, which can raise plant efficiency. Finally, dry cooling is essentially a closed-loop system, which is exceedingly useful in areas where water is scarce. This latter type of cooling is what allows thermal plants to operate even in desert regions.

As the global climate changes – with more extreme weather events – picking the right cooling solution is more important than ever, and has us looking at retrofitting existing thermal plants with more efficient solutions. If you were ever curious how power plants keep the cool side cool, read on!

Continue reading “Keeping Thermal Plants Cool Without Breaking The Cooling Water Budget”

Know Snow: Monitoring Snowpack With The SNOTEL Network

With summer just underway here in North America, it may seem like a strange time to talk about snow. But when you live in North Idaho, winter is never very far away and is always very much on everyone’s mind. Our summers are fierce but all too brief, so starting around September, most of us begin to cast a wary eye at the peaks of the Bitterroot range in the mornings, looking for the first signs of snow. And in the late spring, we do much the same, except longingly looking for the first signs that the snowpack is finally breaking up.

We all know how important snow is, of course. Snow is our lifeline, nearly the only source of drinking water we have here, as well as the foundation of our outdoor recreation industries. We also know that the snowpack determines our risk for wildfires, so while the long, dark winters may take a psychological toll, the longer the snow stays on the mountains, the less chance we have of burning come summer.

These are all very subjective measures, though, and there’s way too much riding on the snowpack to leave it up to casual observation. To make things more quantitative, the US Department of Agriculture’s Natural Resources Conservation Service (NRCS) has built a system across the western US that measures the snowpack in real-time, and provides invaluable data to climatologists, fish and game managers, farmers, and even the recreation industry, all of whom have a vested interest in the water held within. The network is called SNOTEL, and I recently got a chance to take a field trip with a hydrologist and get an up-close look at how it works.

Continue reading “Know Snow: Monitoring Snowpack With The SNOTEL Network”

Wind-to-Heat: A Lot Of Hot Air?

Heating is one of the greatest uses of energy in human society today. Where we once burned logs to stave off the brutal winter chill, now we lean on gas and electricity to warm our homes and keep us safe and toasty. In some colder climates, like the UK, heating can make up 60-80% of total domestic energy demands.

However, there are alternative ways to provide heating. Using wind energy to directly provide heat could be key in this area, using a variety of interesting methods that could have some unique niche applications.

Continue reading “Wind-to-Heat: A Lot Of Hot Air?”