1
\$\begingroup\$

Is there are special circuit that says to USB socket how much current the device needs?

Our device needs at up to 200mA or little bit more.

I have been searching but I do not find a clear answer anywhere. Should there be resistors on data lines or something else? Unit load for USB 2.0 is 100mA and for USB 3.0 it's 150mA according to Wikipedia. How does a the host know how much current to supply? How does the slave ask for load units?

\$\endgroup\$

3 Answers 3

1
\$\begingroup\$

For USB 2, a device cannot take more than 100mA until it has enumerated with host and it has host permission to draw more. Host keeps track how much devices have already requested and how much is still available for more devices, and based on this it either allows the device to use requested power amount or not. Basically, a device can't draw 200mA without asking.

For USB 2 chargers, the charger is just a power supply and has resistances to indicate to device that how much the device can draw.

\$\endgroup\$
1
  • \$\begingroup\$ Many, many USB devices ignore this bit of the specification, though, in my experience. \$\endgroup\$
    – Hearth
    Commented Nov 17, 2019 at 16:47
1
\$\begingroup\$

USB devices report their power consumption needs in "configuration descriptor", in MaxPower field of it, see an example for a USB 3.0 flashdrive:

enter image description here

This info must be revealed to host during initial stage of USB enumeration, when any USB devices don't take more than "one unit of load".

Classic USB devices (before the PowerDelivery era) do not ask for anything, they just "inform". In theory a USB host is supposed to look at the MaxPower data in early stage of device enumeration, and compare it with the available power budget (it should be known to a properly designed system) and either admit or refuse the new connection and let the device to consume up to its MaxPower.

However, if your USB host is on AC power, each port is mandated to supply "at least" 5 units of load, see details here. And here. And here.

\$\endgroup\$
2
  • \$\begingroup\$ "Classic USB devices (before the PowerDelivery era) do not ask for anything, they just inform". A device is requesting a current allocation with each config descriptor. You can have more than one with different values of bMaxPower and a host can cherry pick which one it will accept. You don't get to use any current above the default 1 unit until after the host notifies the device which configuration it has chosen. You are not guaranteed a host will select any configuration. \$\endgroup\$ Commented Feb 14 at 20:59
  • \$\begingroup\$ @KevinThibedeau, I believe there is an important semantics here. A request in English means an act of asking for something by a requestor. A USB device does not make any requests, it only responds with information to requests from USB host. Saying that "a device is requesting" is therefore misleading and causes frequent confusion among unsuspecting public on how the classic USB operates. That's why I always prefer to stress this distinction. \$\endgroup\$ Commented Feb 14 at 21:41
0
\$\begingroup\$

For USB 2.0 from all of my testing I have not yet found a host computer that limits the current drawn for my devices to 100mA before enumeration. I have been told multiple times that to draw the allowed 500mA enumeration is needed but I have see multiple Hosts where this is not the case. I have also found that there are some Host that will easily give even more than 500mA (granted with enumeration).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.