Easiest solution to pull 1.5A from USB-A BC1.2 and PD chargers  - Page 1
Forum section: electronics / projects

author: uer166
author_rank: Super Contributor
timestamp: December 15, 2024, 09:42:25 pm
content: 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 1500mAUSB-PD compliant USB-C charger that can supply 1.5A or more -> pull 1500mAA 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 defaultEdit: 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.

author: bson
author_rank: Unknown
timestamp: December 15, 2024, 10:19:33 pm
content: https://www.ti.com/lit/wp/slyy109b/slyy109b.pdfPage 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.

author: Someone
author_rank: Super Contributor
timestamp: December 15, 2024, 11:00:09 pm
content: Quote from: bson link=topic=447879.msg5748851#msg5748851 date=1734301173[url=https://www.ti.com/lit/wp/slyy109b/slyy109b.pdfI 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

author: uer166
author_rank: Super Contributor
timestamp: December 15, 2024, 11:40:00 pm
content: Quote from: bson on December 15, 2024, 10:19:33 pmAh 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.

author: NiHaoMike
author_rank: Super Contributor
timestamp: December 16, 2024, 01:04:55 am
content: 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.

author: Someone
author_rank: Super Contributor
timestamp: December 16, 2024, 04:06:37 am
content: Quote from: uer166 on December 15, 2024, 11:40:00 pmUSB battery charging is not a mandatory part of USB-C so could be hit and miss (particularly into the future) relying on that.

author: uer166
author_rank: Super Contributor
timestamp: December 16, 2024, 05:12:13 am
content: Quote from: Someone on December 16, 2024, 04:06:37 amTrue,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.

author: amyk
author_rank: Super Contributor
timestamp: December 16, 2024, 06:49:49 am
content: Quote from: uer166 on December 16, 2024, 05:12:13 amYou 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.

author: jbb
author_rank: Super Contributor
timestamp: December 16, 2024, 09:19:57 am
content: 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...

author: uer166
author_rank: Super Contributor
timestamp: December 17, 2024, 03:15:11 am
content: Quote from: amyk on December 16, 2024, 06:49:49 amAh 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 3ATry CC line sense for 1.5A, pull 3ATry 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 elseThis likely would keep it reasonable and not annoying for vast majority of cases.