Author Topic: Controlling the power consumed by a USB Device  (Read 6988 times)

egovind

  • Member
  • ***
  • Posts: 14
Controlling the power consumed by a USB Device
« on: September 22, 2014, 03:23:05 am »
Hi,

I'm developing an Embedded USB Host for Android Phones that support AOA (Android Open Accessory) framework. The particular phone (Sony Experia) I'm testing with always sends bMaxPower = 0xFA where as my embedded host can only supply max of 100mA. This does not seem to be an issue most of the time, however if the phone battery is low (~ 50%) then it fails to enumerate. While everything works OK when the phone is fully charged. So I suspect that it's something to do with the inability of my device to supply 500mA requested by the phone. Is there some way for the host to tell the phone that it can only supply 100mA without breaking the USB communication?

Govind

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Controlling the power consumed by a USB Device
« Reply #1 on: September 25, 2014, 01:36:21 pm »
If the phone needs more than 100 mA, it's not going to work with a host that provides only 100 mA unless you can add a self powered hub.

egovind

  • Member
  • ***
  • Posts: 14
Re: Controlling the power consumed by a USB Device
« Reply #2 on: September 27, 2014, 10:52:14 am »
Thanks a lot for the response. The odd thing though is that I only have this problem after I downloaded Sony's upgrade to Android. I have another phone running the older version of Android, and it works fine :(

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Controlling the power consumed by a USB Device
« Reply #3 on: September 28, 2014, 06:09:34 pm »
A host can be more lenient than the spec if it wants, but devices shouldn't rely on it.

egovind

  • Member
  • ***
  • Posts: 14
Re: Controlling the power consumed by a USB Device
« Reply #4 on: September 28, 2014, 10:25:27 pm »
I thought that the USB spec was that Hosts should guarantee 100mA for devices; but devices that want more can later try to negotiate for 500mA? In this case, my device is the Host and is capable of providing 100mA but looks like the Phone wants more under some conditions and is unable to work when it can't get 500mA..

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Controlling the power consumed by a USB Device
« Reply #5 on: September 29, 2014, 11:16:08 am »
Requesting more power requires host and device support for an alternate configuration, and hosts rarely provide this.

The USB Power Delivery spec provides more options, but support for this is in the future.

Bret

  • Frequent Contributor
  • ****
  • Posts: 68
Re: Controlling the power consumed by a USB Device
« Reply #6 on: September 29, 2014, 02:00:38 pm »
Power management in USB is very tricky -- a lot of devices tell lies about their power parameters.  End devices can and do lie in their descriptors about how much power they actually require (particularly things like the "surge" power that may be needed when a device first starts up), and hubs can and do lie about their power providing capabilities (e.g., claiming in their descriptors to be self powered when they aren't).  When it comes to power, you have to look at anything a device tells you with a grain of salt.

egovind

  • Member
  • ***
  • Posts: 14
Re: Controlling the power consumed by a USB Device
« Reply #7 on: September 30, 2014, 12:05:29 am »
Thank you both for your replies. I have contacted Sony and actually got a response that they will look into it. I'll re-post if something interesting comes up :)