1
\$\begingroup\$

I am trying to design a USB device (slave), that should draw the maximum of 900 mA (USB3.0) current from a computer's USB port.

According to the USB specs, current is provided in "unit loads" by the host. In case of USB3.0, 1 unit load = 150 mA, and one device can draw a maximum of 6 unit loads (i.e. 900 mA).

I am aware of the 'bMaxPower' descriptor of the USB device, which can be used to set the current requirement. According to the USB specs, it is expressed in 2-mA units when the device is operating in Hi-speed mode (USB2.0), and in 8-mA units when device operating is SuperSpeed mode.

Most USB slave chips are only capable of USB2.0's Fullspeed or Hi-speed protocols, like the popular FTDI FT232. Is it possible to draw the maximal 900 mA with this chip, or can you recommend another one, that works?

Or maybe there's no current portioning on the host side at all, only some overcurrent protection, and I can have all the current without playing around with the descriptors, etc.? Am I over-complicating this issue?

\$\endgroup\$
3
  • \$\begingroup\$ is this a real product or just some DIY project? because for the latter, you should know there's no current limiting on most hosts. If you're making something like a real product to sell then you have to follow the specs or people will return your product and give it bad reviews if it doesn't work. \$\endgroup\$
    – user20574
    Commented Mar 17, 2023 at 10:34
  • \$\begingroup\$ It won't be a product, only a home project, but I want to do it properly. I need clear information on what hosts really do and what they don't do when enumerating a new device. This info cannot be found in the 3.0 specifications, nor in the datasheet of USB chips. \$\endgroup\$
    – irdatlanSE
    Commented Mar 17, 2023 at 13:26
  • \$\begingroup\$ 99% of hosts, including yours, have no current limiting. Many of them do however have short-circuit protection, which kicks in higher than all supported current levels, regardless of whether the current has been negotiated or not. \$\endgroup\$
    – user20574
    Commented Mar 17, 2023 at 14:15

1 Answer 1

1
\$\begingroup\$

... device (slave), that should draw the maximum of 900mA. Is it possible to draw the maximal 900mA with this [USB2] chip ?

I guess you mean your device "needs 900 mA" for full functionality, not "should draw".

The general answer is "yes", if you design the device correctly.

First, you need to follow the specifications that a device cannot draw more than "1 unit of load" until it is "configured by host". This means that your USB Serial Interface Engine (SIE, the part responsible for providing initial response to enumeration process, answer the GET_DESCRIPTOR, accept SET_NEW_ADDRESS, etc.) should operate drawing no more than 100mA at the beginning. The device can draw the full-required power only if the host concludes the enumeration with SET_CONFIGURATION(). The host may not configure the device if it has some sophisticated power policy and believes it may run out of power. In this (rare) case the device might be denied the connection (by host not sending SET_CONFIGURATION(). A correctly-designed device will enter a low power state and won't function. This process works for most legacy Type-A ports.

Therefore technically you need to stop the process of accepting the set_configuration until your determine if you are plugged into USB2 or USB3 port. Unfortunately, no cheap USB chips have this discretion, so you need a USB chip that stays within 100 mA, and have some additional logic that delays full-power function of your device unless you determine that the port is a USB3 port.

Since you are using a USB2 device, you will need a separate means to detect the USB3 port. The obvious way is to detect if the port does have the Rx/Tx connections/signals. Obviously your USB2 device would need to have a USB3 connector to do such detection.

One way to detect the presence of USB3 pins is to detect the Rx_Detect common-mode pulses on Tx pins using some simple receiver. A USB3 port will transmit short positive pulses on both Tx pins periodically (see description of Rx_detect process in USB3 specifications).

The other way is to set 45 Ohm termination on Rx lines and watch for LFPS activity from the host side.

After your (additional) logic has determined that you have USB3 port, you can start the rest of your functionality. If USB3 is not detected, you should shut down your device.

Yet another alternative is to forget all the above and implement VBUS monitoring in your device, and if the VBUS drops more than, say, 0.5 V after engaging your load, just disconnect/shut yourself down.

See also https://electronics.stackexchange.com/a/510157/117785

\$\endgroup\$
2
  • \$\begingroup\$ You can't (within the spec) draw 900mA from a USB3 port when enumerated as a USB2 device. The 8-bit configuration descriptor field bMaxPower can only exceed 500mA when enumerated over USB3 where it is defined in increments of 8mA instead of 2mA (2*255 = 510mA max, 8*255 = 2.04A max). The only valid way is to implement USB-PD for USB2 and use that to negotiate a higher current. Simply detecting the USB3 pins doesn't give free license to draw more current than declared in a proper descriptor. \$\endgroup\$ Commented Feb 14 at 19:15
  • \$\begingroup\$ @KevinThibedeau, . The distinction you mention is formally valid, but the distinction is moot because there are no means in classic USB-IF to measure the actual current draw and enforce this policy. Even if bMaxPower device descriptors inform the host about their power needs, the support for power budget allocation was never implemented in any OS for classic Type-A environment, AFAIK. There are millions USB2 devices (mostly HDD enclosures) on the market that take 1.5-1.8A from USB-A ports, and no household was burnt because of that. \$\endgroup\$ Commented Feb 14 at 22:15

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.