User avatar
Morgaine
Posts: 141
Joined: Mon Mar 12, 2012 1:13 am

USB spec and the duties of a USB power sink

Sat May 19, 2012 4:21 pm

A USB power sink is supposed to (i) identify itself as a USB device, and (ii) announce that it wants to use more than 100mA, if it needs more than this base load which is available to every port. Since the Pi's micro-USB has no data lines connected, it can neither self-identify nor announce its power requirements, so it would appear to be non USB compliant.

This could be a serious problem if we want to power a Pi from a full-spec powered USB hub via a type-A-to-micro-B lead. The Pi should announce that it wants more than 100mA, but it can't. ....

It occurs to me that there might be an exemption from USB spec compliance specifically for dumb chargers that are not really USB devices at all, but just use the micro-USB type B plug. Does anyone know if this is the case?

It worries me that there might indeed be such an exemption, the end result of which could explain the dire state of cellphone chargers that we have witnessed. They shouldn't really be regarded as USB-spec power supplies at all.

In any case, the fact that the Pi is not USB compliant for powering from a fully compliant powered USB hub is an issue to consider.

Morgaine.
Intolerance is a failure of education. Education is predicated on tolerance of the uneducated.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4247
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: USB spec and the duties of a USB power sink

Sat May 19, 2012 4:32 pm

The USB Battery Charging Specification of 2007 defines new types of USB ports, e.g., charging ports.[46] As compared to standard downstream ports, where a portable device can only draw more than 100 mA current after digital negotiation with the host or hub, charging ports can supply currents above 0.5 A without digital negotiation. A charging port supplies up to 500 mA at 5 V, up to the rated current at 3.6 V or more, and drop its output voltage if the portable device attempts to draw more than the rated current. The charger port may shut down if the load is too high.
See: Wikipedia

User avatar
Morgaine
Posts: 141
Joined: Mon Mar 12, 2012 1:13 am

Re: USB spec and the duties of a USB power sink

Sat May 19, 2012 4:41 pm

Excellent, thank rurwin. :)

But what's this about "up to the rated current at 3.6 V or more"? If that's the spec for USB chargers, then it's no wonder that people have found their Pi to be unstable, since 3.6V is not in-spec for the normal USB +5V rail nor is it in spec for the rest of the Pi's circuitry.

If 3.6V is "OK" for a charger, then the Pi should never have been designed to be powered from USB chargers.

Morgaine.
Intolerance is a failure of education. Education is predicated on tolerance of the uneducated.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4247
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: USB spec and the duties of a USB power sink

Sat May 19, 2012 4:46 pm

Yes, that worried me too. There is an open question of how relevant to real-world devices it is, but it does suggest that some chargers may be unsuitable.

ETA: If you follow ref 46 above you can find the actual spec. Which states (my square brackets):
A device having a Dedicated Charging Port is required to specify on its packaging or casing, the rated
current at which the output voltage of the Dedicated Charging Port is capable to supply VCHG [4.75V-5.25V]. The actual
current at which the Dedicated Charging Port voltage drops to 3.6V is required to be within +50%/-0% of the
current value specified on the package or casing.
So a charger labelled 1000mA is required to output good RaspPi voltage at currents up to 1000mA. It can then drop the voltage to maintain the current (and must drop the voltage to 3.6V at or below 1500mA) until the voltage drops to 2V at which time it can limit current.

Executive summary: All's well.

User avatar
Morgaine
Posts: 141
Joined: Mon Mar 12, 2012 1:13 am

Re: USB spec and the duties of a USB power sink

Sat May 19, 2012 5:25 pm

If that paragraph from ref 46 is right then the Wikipedia info you quoted is wrong. It wouldn't be the first time, lol. :P

I think chargers need some serious testing.

Thanks again. :)
Intolerance is a failure of education. Education is predicated on tolerance of the uneducated.

User avatar
Morgaine
Posts: 141
Joined: Mon Mar 12, 2012 1:13 am

Re: USB spec and the duties of a USB power sink

Sat May 19, 2012 5:51 pm

In your travels through the USB spec, did you happen to see how a powered hub is supposed to react to an attempt by an unidentified device to draw more than 100mA from a port?

I'm still wondering if I can use a powered hub and a type-A-to-micro-B lead to power the Pi at up to 500mA. If the spec says to treat unidentified devices with extreme prejudice, then I guess the answer is No.
Intolerance is a failure of education. Education is predicated on tolerance of the uneducated.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4247
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: USB spec and the duties of a USB power sink

Sat May 19, 2012 6:06 pm

Morgaine wrote: the Wikipedia info you quoted is wrong.
Yes; the 3.6V should read 2V, and the rest is so abbreviated that it is significantly misleading.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4247
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: USB spec and the duties of a USB power sink

Sat May 19, 2012 6:11 pm

Morgaine wrote:In your travels through the USB spec, did you happen to see how a powered hub is supposed to react to an attempt by an unidentified device to draw more than 100mA from a port?

I'm still wondering if I can use a powered hub and a type-A-to-micro-B lead to power the Pi at up to 500mA. If the spec says to treat unidentified devices with extreme prejudice, then I guess the answer is No.
I haven't seen that in the spec, but I understand that it is undefined and that most laptops and hubs just connect VBUS to the 5V power line. So in practise the power available is unlimited. That will depend on the hub of course; the more correct ones may limit it to 500mA which is not enough for a RaspPi.

Return to “General discussion”