Ramblings of an aging IT geek
← Ramblings of an aging IT geek
hardware

poking at a usb-c charger until it gave me 20 volts

A weekend spent sniffing the USB Power Delivery negotiation on the CC line to understand how a charger and a laptop agree on a voltage, using a cheap logic-level trigger board rather than a proper protocol analyser.

A soldering iron over a small circuit board

I wanted to power a small project board from a USB-C charger at something other than 5V, and to do that I needed to understand how a laptop persuades the same charger to hand over 20V when a phone gets 5V from an identical-looking cable. The answer is USB Power Delivery, and it is more conversation than I expected.

The whole negotiation happens on a single wire: the CC (Configuration Channel) pin. There are two CC pins on the connector, but only one is connected through a normal cable, and that one carries the handshake. The charger advertises a list of "source capabilities", each a voltage and a current it is willing to provide. The device picks one, requests it, and only then does the charger actually switch its output from the default 5V to the requested level. Until that request happens, every PD charger sits quietly at 5V, which is why a dumb device gets 5V and a clever one gets more.

A close-up of the CC line probe on the breakout board

I did not have a proper PD analyser, so I cheated. There are cheap USB-C breakout boards that expose every pin on a header, and I tapped the CC line into a logic analyser to watch the traffic. The messages are not simple level changes, they are BMC-encoded packets, so the raw capture looked like noise until I slowed the timebase right down and saw the structure: a preamble, then the framing, repeating each time I plugged the cable in.

Decoding it properly by hand was more than a weekend would allow, so for the actual project I took the pragmatic route. There is a class of small "PD trigger" boards built around a dedicated chip (the ones I found use an injene or similar PD sink controller) that do the negotiation for you and let you select the target voltage with a resistor or a couple of solder jumpers. You tell it "I want 20V", it does the CC handshake, and it only presents that voltage on its output once the charger has agreed. Set it wrong and it stays at 5V rather than frying anything, which is exactly the safety behaviour the spec intends.

What I took away is respect for how careful the design is. The high voltages are never present until both ends have explicitly agreed, the negotiation lives on a wire that an old cable simply does not connect, and a device that knows nothing about PD gets a safe default. It would have been easy to design this so that a cheap cable or a confused device let the magic smoke out. Instead the worst case of getting it wrong is that you stay at 5V and your project does not power up. For the board I was building, the trigger chip was the right answer; understanding the CC handshake first meant I knew why it worked, which is the part I actually came for.