Author Topic: Easiest solution to pull 1.5A from USB-A BC1.2 and PD chargers  (Read 570 times)

0 Members and 1 Guest are viewing this topic.

Offline uer166Topic starter

  • Super Contributor
  • ***
  • Posts: 1022
  • Country: us
Easiest solution to pull 1.5A from USB-A BC1.2 and PD chargers
« on: December 15, 2024, 09:42:25 pm »
I have a USB device with a 3.5Ah cell that currently charges at 500mA thru a linear charger IC. I've gotten complaints about it being too slow and wanna upgrade to an SMPS that can pull up to 1.5A from chargers. The device has a USB-C connector with 2.0-signaling only (the usual CC1/2 and D+/-). What would be the easiest FW-lightweight way to detect a charger connected instead of just a computer USB port, preferably standards-compliant with the exception of 100mA max current (I am okay pulling 500mA out of computer ports without negotiation). The use cases are:

  • USB-A charger that can supply 1.5A or more (there are various schemes but I don't know what the most popular are -> pull 1500mA
  • USB-PD compliant USB-C charger that can supply 1.5A or more -> pull 1500mA
  • A normal USB-A or USB-C port in a computer -> pull 500mA by default: noncompliant but I don't care. What matters is that it doesn't pull the 1500mA that it would in above cases.
  • All other cases where it detects 5V at the VUSB -> pull 500mA default

Edit: I should add that the device has a MCU with spare ADC pins etc, so while I do not want to implement any kind of USB data protocol, sensing various pull-ups/downs and controlling GPIOs is totally fine.
« Last Edit: December 15, 2024, 09:44:24 pm by uer166 »
 

Offline bson

  • Supporter
  • ****
  • Posts: 2493
  • Country: us
Re: Easiest solution to pull 1.5A from USB-A BC1.2 and PD chargers
« Reply #1 on: December 15, 2024, 10:19:33 pm »
https://www.ti.com/lit/wp/slyy109b/slyy109b.pdf

Page 4 and onwards.

Edit: the DFP pulls up CC to 5V with 22k (1.5A 7.5W) or 10k (3A 15W).  The UFP (your device) pulls it down with 5.1k.  You check the voltage on the CC pin(s) and if 1.16V (+/-5%) you can load VBUS with 1.5A.  If it's 2.55V (+/-5%) you can load it with 3A.  You can just sample it with the ADC on your uC.  You have to check BOTH CC lines.
« Last Edit: December 15, 2024, 10:31:05 pm by bson »
 
The following users thanked this post: uer166, SiliconWizard

Offline Someone

  • Super Contributor
  • ***
  • Posts: 5128
  • Country: au
    • send complaints here
Re: Easiest solution to pull 1.5A from USB-A BC1.2 and PD chargers
« Reply #2 on: December 15, 2024, 11:00:09 pm »
Quote from: bson link=topic=447879.msg5748851#msg5748851 date=1734301173[url=https://www.ti.com/lit/wp/slyy109b/slyy109b.pdf
https://www.ti.com/lit/wp/slyy109b/slyy109b.pdf[/url]

Page 4 and onwards.
I find that reference a little light on details, missing variation of the pull-ups for example. ST go a little further without being to complex:
https://www.st.com/resource/en/technical_article/ta0357-overview-of-usb-typec-and-power-delivery-technologies-stmicroelectronics.pdf
 
The following users thanked this post: uer166

Offline uer166Topic starter

  • Super Contributor
  • ***
  • Posts: 1022
  • Country: us
Re: Easiest solution to pull 1.5A from USB-A BC1.2 and PD chargers
« Reply #3 on: December 15, 2024, 11:40:00 pm »
https://www.ti.com/lit/wp/slyy109b/slyy109b.pdf

Page 4 and onwards.

Edit: the DFP pulls up CC to 5V with 22k (1.5A 7.5W) or 10k (3A 15W).  The UFP (your device) pulls it down with 5.1k.  You check the voltage on the CC pin(s) and if 1.16V (+/-5%) you can load VBUS with 1.5A.  If it's 2.55V (+/-5%) you can load it with 3A.  You can just sample it with the ADC on your uC.  You have to check BOTH CC lines.

Ah that makes it quite easy, however the doc doesn't seem to be clear about supporting BC1.2 over a USB A-> USB C cable which is often used. I wonder if I can just assume that the USB chargers short the D+/D- together, and by simply pulling up on D+ determine that.
 

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9310
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Easiest solution to pull 1.5A from USB-A BC1.2 and PD chargers
« Reply #4 on: December 16, 2024, 01:04:55 am »
I wonder if it would be simple enough to detect that it's plugged into a USB 3.0 port by checking for some signal on the USB 3.0 lines, in which case you can pull 900mA. With the old type B connectors, you can just check that the USB 3 ground is in fact connected to ground but that doesn't work for type C.

Detecting that the two data lines are connected to each other is quite simple, pull up one to the supply rail with a 100k resistor, connect the other to a GPIO with a 1M pulldown.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 5128
  • Country: au
    • send complaints here
Re: Easiest solution to pull 1.5A from USB-A BC1.2 and PD chargers
« Reply #5 on: December 16, 2024, 04:06:37 am »
https://www.ti.com/lit/wp/slyy109b/slyy109b.pdf

Page 4 and onwards.

Edit: the DFP pulls up CC to 5V with 22k (1.5A 7.5W) or 10k (3A 15W).  The UFP (your device) pulls it down with 5.1k.  You check the voltage on the CC pin(s) and if 1.16V (+/-5%) you can load VBUS with 1.5A.  If it's 2.55V (+/-5%) you can load it with 3A.  You can just sample it with the ADC on your uC.  You have to check BOTH CC lines.
Ah that makes it quite easy, however the doc doesn't seem to be clear about supporting BC1.2 over a USB A-> USB C cable which is often used. I wonder if I can just assume that the USB chargers short the D+/D- together, and by simply pulling up on D+ determine that.
USB battery charging is not a mandatory part of USB-C so could be hit and miss (particularly into the future) relying on that.
 

Offline uer166Topic starter

  • Super Contributor
  • ***
  • Posts: 1022
  • Country: us
Re: Easiest solution to pull 1.5A from USB-A BC1.2 and PD chargers
« Reply #6 on: December 16, 2024, 05:12:13 am »
https://www.ti.com/lit/wp/slyy109b/slyy109b.pdf

Page 4 and onwards.

Edit: the DFP pulls up CC to 5V with 22k (1.5A 7.5W) or 10k (3A 15W).  The UFP (your device) pulls it down with 5.1k.  You check the voltage on the CC pin(s) and if 1.16V (+/-5%) you can load VBUS with 1.5A.  If it's 2.55V (+/-5%) you can load it with 3A.  You can just sample it with the ADC on your uC.  You have to check BOTH CC lines.
Ah that makes it quite easy, however the doc doesn't seem to be clear about supporting BC1.2 over a USB A-> USB C cable which is often used. I wonder if I can just assume that the USB chargers short the D+/D- together, and by simply pulling up on D+ determine that.
USB battery charging is not a mandatory part of USB-C so could be hit and miss (particularly into the future) relying on that.

True,

I was thinking of detecting USB C via the CC lines first, and if both are floating, try to detect BC1.2 via shorted Dp/Dm lines.

Unfortunately I found that a bunch of my USB-A chargers can only provide 1A of current while having Dp/Dm shorted which kind of puts a wrench in the plan or assuming that data lines shorted == BC1.2 == 1.5A.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8509
Re: Easiest solution to pull 1.5A from USB-A BC1.2 and PD chargers
« Reply #7 on: December 16, 2024, 06:49:49 am »
Unfortunately I found that a bunch of my USB-A chargers can only provide 1A of current while having Dp/Dm shorted which kind of puts a wrench in the plan or assuming that data lines shorted == BC1.2 == 1.5A.
You can do what a lot of phones do, which is to increase the current until the voltage drops too much, like some sort of MPPT scheme, sensing the source impedance and adjusting appropriately. Note that you can usually get ~1A out of USB ports on computers.
 

Offline jbb

  • Super Contributor
  • ***
  • Posts: 1257
  • Country: nz
Re: Easiest solution to pull 1.5A from USB-A BC1.2 and PD chargers
« Reply #8 on: December 16, 2024, 09:19:57 am »
Consider moving to a switch mode charger IC too.  You'll get a slight speedup in the bulk charge and also cut down on waste heat, which can become a major problem depending on your product design.  Especially if you go up to 1.5A charging current...
 

Offline uer166Topic starter

  • Super Contributor
  • ***
  • Posts: 1022
  • Country: us
Re: Easiest solution to pull 1.5A from USB-A BC1.2 and PD chargers
« Reply #9 on: December 17, 2024, 03:15:11 am »
Unfortunately I found that a bunch of my USB-A chargers can only provide 1A of current while having Dp/Dm shorted which kind of puts a wrench in the plan or assuming that data lines shorted == BC1.2 == 1.5A.
You can do what a lot of phones do, which is to increase the current until the voltage drops too much, like some sort of MPPT scheme, sensing the source impedance and adjusting appropriately. Note that you can usually get ~1A out of USB ports on computers.

Ah that's what my Pixel does, I was wondering why it was pulling >1A out of a 1A charger brick. I think a good compromise would be:

  • Try CC line sense for 3A, pull 3A
  • Try CC line sense for 1.5A, pull 3A
  • Try USB D+/D- shorted, pull 1A (even though BC1.2 specifies 1.5A, seems that lots of chargers do the same without providing 1A)
  • Pull 0.5A for everything else

This likely would keep it reasonable and not annoying for vast majority of cases.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf