Jump to content

How Does USB C Power Negotiation Protocol Works?

DaveKK

As per the title. I googled for a while but I'm not sure i understand it. Can somebody ELI5?

 

Basically I saw my newer smartphone pulling around 8V 1.6A when charging, while older smartphone just pulling around 5V 0.8A. I attached a USB power meter over my charger and get the readings.

 

I'm thinking of powering my IoT devices over USB 3 charging port hopefully able to pull more power for high power components like relays.

Link to comment
Share on other sites

Link to post
Share on other sites

I'm not really an expert, but I can do some basic explaining:

The USB Implementers Forum that designs the standards for USB devices came up with a standard called USB-PD (Power Delivery). The basic concept is: because USB-C is no longer directional (previously you always had USB-A on one end and USB-B/mini/micro on the other end of a cable, it was clear which side was providing the power), a USB-C charger is not supposed to provide power (not 100% correct, I think the charger still provides 5V, but limits the current) unless specifically requested by the connected device. To accomplish this, the USB-C connector has 2 pins designated as communications channels (CC1 and CC2, 2 because the plug is symmetric, if you turn your cable upside down it still needs to work.) On the device that gets charged, there could either be a small chip that handles the power negotiation with the charger, or for very basic devices, those communications channel pins could just be connected to another pin via a resistor. Based on the resistor configuration, the charger will then provide a certain voltage. 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Alvin853 said:

I'm not really an expert, but I can do some basic explaining:

The USB Implementers Forum that designs the standards for USB devices came up with a standard called USB-PD (Power Delivery). The basic concept is: because USB-C is no longer directional (previously you always had USB-A on one end and USB-B/mini/micro on the other end of a cable, it was clear which side was providing the power), a USB-C charger is not supposed to provide power (not 100% correct, I think the charger still provides 5V, but limits the current) unless specifically requested by the connected device. To accomplish this, the USB-C connector has 2 pins designated as communications channels (CC1 and CC2, 2 because the plug is symmetric, if you turn your cable upside down it still needs to work.) On the device that gets charged, there could either be a small chip that handles the power negotiation with the charger, or for very basic devices, those communications channel pins could just be connected to another pin via a resistor. Based on the resistor configuration, the charger will then provide a certain voltage. 

 

Is it possible to ask the charger to provide a specific level of voltage and current? How do we "ask" the charger to do it?

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, DaveKK said:

 

Is it possible to ask the charger to provide a specific level of voltage and current? How do we "ask" the charger to do it?

You can't really ask for a specific current, only a current limit and a specific voltage, the current will be decided by what the device actually draws. It seems that by using resistors, you can only tell the charger to run in different 5V current limit modes (56k resistor will limit to 900mA, the default for USB3, 22k will limit to 1.5A, and 10k will limit to 3A, the max that most cables and chargers can do), if you require anything else than 5V, you need a microchip negotiating with the charger, either make one yourself, or find a controller from TI, Infineon or whoever makes these kind of chips. 
USB-C%20resistor

Link to comment
Share on other sites

Link to post
Share on other sites

I found this ready-to use board:
https://www.digikey.com/en/product-highlight/c/cypress/ez-pd-bcr-usb-c-controller
You just plug in USB-C, there's a dial on the board to select the voltage you want, and it has a barrel plug for output where you can just connect whatever device you want powered. If you want to DiY it, you need to look up the controllers used and how to configure them to request a certain voltage from the charger. 

Link to comment
Share on other sites

Link to post
Share on other sites

29 minutes ago, Alvin853 said:

You can't really ask for a specific current, only a current limit and a specific voltage, the current will be decided by what the device actually draws. It seems that by using resistors, you can only tell the charger to run in different 5V current limit modes (56k resistor will limit to 900mA, the default for USB3, 22k will limit to 1.5A, and 10k will limit to 3A, the max that most cables and chargers can do), if you require anything else than 5V, you need a microchip negotiating with the charger, either make one yourself, or find a controller from TI, Infineon or whoever makes these kind of chips. 
USB-C%20resistor

 

So essentially if i connect a 10kohm resistor between CC1 and CC2, I'll get 5V with 3A limit over +V pin and GND pin?

image.png.2454d1c8b441ec9cd7d3f1c9c2eff804.png

 

PS: Excuse my poor photoshop skill

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, DaveKK said:

 

So essentially if i connect a 10kohm resistor between CC1 and CC2, I'll get 5V with 3A limit over +V pin and GND pin?

image.png.2454d1c8b441ec9cd7d3f1c9c2eff804.png

Now that's the part I'm not sure about, I think you need to connect two 10k resistors from each of CC1 and CC2 to any of the GND pins.

image.png.b200671c6e0246de9f2b2f2a0a8a26a7.png

R_d are the resistors on the device being powered, labeled "Sink" in the official documentation.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Alvin853 said:

Now that's the part I'm not sure about, I think you need to connect two 10k resistors from each of CC1 and CC2 to any of the GND pins.

image.png.b200671c6e0246de9f2b2f2a0a8a26a7.png

R_d are the resistors on the device being powered, labeled "Sink" in the official documentation.

What about Ra though? Seems like require more resistors. It would be nice if there is a working simple circuit that we can try out to understand more how it behave.

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, DaveKK said:

What about Ra though? Seems like require more resistors. It would be nice if there is a working simple circuit that we can try out to understand more how it behave.

R_a is inside the cable, that's not something you need to worry about, unless you're making your own USB-C cables, your device only has to deal with what's on the "Sink" side of the diagram.

 

Edit: To clarify, inside the cable, only CC1 is connected to both plugs, CC2 is connected to ground, this serves as orientation detection, because CC1 of the cable could be connected to CC1 or CC2 on either port. Since CC2 is connected to ground, it would cause a short to ground if connected to a device that doesn't have the proper resistors on the CC lines, so the R_a is for protection in that situation. 

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, Alvin853 said:

R_a is inside the cable, that's not something you need to worry about, unless you're making your own USB-C cables, your device only has to deal with what's on the "Sink" side of the diagram.

 

Edit: To clarify, inside the cable, only CC1 is connected to both plugs, CC2 is connected to ground, this serves as orientation detection, because CC1 of the cable could be connected to CC1 or CC2 on either port. Since CC2 is connected to ground, it would cause a short to ground if connected to a device that doesn't have the proper resistors on the CC lines, so the R_a is for protection in that situation. 

I see, are both Rd 10kohm resistors? Or 5kohm each and add up total 10kohm?

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, DaveKK said:

I see, are both Rd 10kohm resistors? Or 5kohm each and add up total 10kohm?

Reading the specs again, I think R_d actually is supposed to be 5kohm each, the 10kohm resistors would be the on the charger side, R_p in that diagram. So yeah 2 5kohm resistors from each of the CC pins to ground should get you 5V up to 3A on V+ for whatever you need.

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, Alvin853 said:

Reading the specs again, I think R_d actually is supposed to be 5kohm each, the 10kohm resistors would be the on the charger side, R_p in that diagram. So yeah 2 5kohm resistors from each of the CC pins to ground should get you 5V up to 3A on V+ for whatever you need.

Thanks for the info. I'm going to try it out.

Link to comment
Share on other sites

Link to post
Share on other sites

There are chips which can do the negotiating for you.

For example see 

with STUSB4500 from ST :  https://hackaday.com/2019/10/18/usb-power-delivery-for-all-the-things/ or  https://learn.sparkfun.com/tutorials/power-delivery-board---usb-c-qwiic-hookup-guide/all

max77958 : https://www.maximintegrated.com/en/products/interface/universal-serial-bus/MAX77958.html and https://www.embedded.com/how-standalone-power-delivery-controllers-simplify-usb-c-pd-design/   (mentions MAX77958)

 

another :  https://www.nisshinbo-microdevices.co.jp/en/products/usb-type-c-power-delivery/rn5u700.html

 

or FTDI's FT4232 / 4233 : https://www.ftdichip.com/old2020/Products/ICs/FT423xHP.htm

 

With the right keywords, you'll find Chinese chips that are much cheaper but dumber/simpler (ex short a pin to ground to tell the chip that it can negotiate up to 12v) or you can set the maximum voltage and current to negotiate by using specific resistor values on some pins. The above chips can be configured through I2c or some serial data or I guess they could be programmed through serial and then they'll work on their own.

 

For example IP2721 :  https://datasheet.lcsc.com/lcsc/2006111335_INJOINIC-IP2721_C603176.pdf

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×