tomek-szczesny / OpenUPS

A versatile, high power SBC UPS
11 stars 0 forks source link

USB PD output #13

Closed tomek-szczesny closed 1 year ago

tomek-szczesny commented 1 year ago

Since we've committed to USB-PD output, it'd be nice to actually implement it at some point.

The problem is, each user may have different expectations for this port. Someone may mistake it for a power input. Others may wish to charge their laptops off it. All compliant devices require special signalling on CC pins to source current from USB-C, and conversely, should offer a handshake, otherwise we may run into situation of two chargers playing tug of war. There must be some chip or another to advertise supported modes of operation and avoid damage.

Ideally we want a chip that does all that: Advertise voltage and power options, limited to some sane value like 30W, and drives a switch or a built-in power converter.

One solid candidate is TPS25740, although it seems that it must be accompanied by a separate voltage converter it could control directly. This may be arranged, but again, cost, space, all that stuff.

We could limit the scope of USB PD to 5V output only (that was the original goal), but I can't find chips with such limited scope. The only suitable chip for this task we've identified so far is IP6518 that is hard to source outside Sinoverse. A Western equivalent would be literally perfect.

To wrap it up:

hominoids commented 1 year ago

Something similar to the Ti chip is the onsemi FUSB15101MNTWG.

This might be the perfect solution though since it appears to be fully self contained, just add power, Infineon CYPD3177-24LQXQT

tomek-szczesny commented 1 year ago

That Onsemi chip is a suitable alternative, thanks. I was thinking, maybe of these two would work just fine with 5V connected right into it and without the extra power converter. A separate converter is generally needed to generate varying voltage levels, but our goal here is just a basic 5V source.

That would be our bare minimum option, in which we merely operate a single switch and signal that we are a 5V 3A capable charger.

The Infineon chip is a USB PD sink controller, the opposite end of a link :)

tomek-szczesny commented 1 year ago

Good grief, my head will explode from all this new information. Here is a a very nice Microchip paper on USB-C, which goes into the details of how exactly CC pins work.

Long story short, PD is not mandatory and not needed for what we're trying to achieve.

So this is what happens:

So if my understanding is correct, all we need is:

tomek-szczesny commented 1 year ago

Ah, here's a good candidate: A dedicated USB switch, 3A (limit above 3.5A), active low enable signal, $.50: https://www.mouser.pl/ProductDetail/Diodes-Incorporated/AP22814BW5-7?qs=lqAf%2FiVYw9gFAqm%252B3YvdqA%3D%3D

Unless we do want to support those non-standard output currents: 4A: https://www.mouser.pl/ProductDetail/Diodes-Incorporated/AP22800HB-7?qs=sGAEpiMZZMv0DJfhVcWlK1Yz3z1OExkkqgcb3xeQGB45NBTOkdirIQ%3D%3D

EDIT: Let's not forget ESD protection...