0

Greater than 100 ma power negotiation
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Greater than 100 ma power negotiation

by earnestblimp on Mon Jun 14, 2010 1:28 am

Hi,
I'd like to properly draw more than the 100 milliamps from the USB host. I'm ok with the restriction that the device must be directly connected to the machine. I see how to use mprog to get the FTDI chip to request more current, and I have transistors on my circuit ready to turn on full power via software when power negotiation is complete, but how do I know *when* to do this? I've searched high and low and cannot find an answer to this.

The brute force approach would be to just wait five seconds or so, then allow the circuit to consume greater current, but I'd like to know if there's a way to get that information from the ftdi chip (i.e. to know in software when power negotiation is complete). I have an arduino mega. Thanks!

earnestblimp
 
Posts: 19
Joined: Thu Sep 17, 2009 10:42 am

Re: Greater than 100 ma power negotiation

by richms on Wed Jun 16, 2010 4:00 am

Yes, you can program up the fdti chip to ID as taking 500mA, and reconfigure its pins to control power to the device as in turn it off when entering sleep mode etc.

The big question is why you want to? Things work just fine with it reporting 100mA to the host and taking a hell of a lot more than that. Best case you will just start to get USB power issue errors when connecting to hubs.

richms
 
Posts: 558
Joined: Tue Jan 20, 2009 3:05 am
Location: New Zealand

Re: Greater than 100 ma power negotiation

by earnestblimp on Wed Jun 16, 2010 10:35 am

Yes, you can program up the fdti chip to ID as taking 500mA, and reconfigure its pins to control power to the device as in turn it off when entering sleep mode etc.


But how do I get notified when it's safe to pull more than 100ma? I need some signal to know when it's ok to turn on the transistors for increased power draw.

The big question is why you want to? Things work just fine with it reporting 100mA to the host and taking a hell of a lot more than that. Best case you will just start to get USB power issue errors when connecting to hubs.


Because you're not guaranteed to get more than 100ma unless you ask for it, according to the USB spec (and even then, I believe the request can be denied). So, even if it works 'most of the time', I would like to be certain that I'm requesting power the right way, so that when things go wrong, I can at least rule that out. Thanks

earnestblimp
 
Posts: 19
Joined: Thu Sep 17, 2009 10:42 am

Re: Greater than 100 ma power negotiation

by richms on Fri Jun 18, 2010 12:41 am

earnestblimp wrote:But how do I get notified when it's safe to pull more than 100ma? I need some signal to know when it's ok to turn on the transistors for increased power draw.


There are other IO pins on the FDTI that are configurable in the windows software, but the default of one of them is to be sleep, another is PWREN which signals that you can turn on. Look here http://www.ftdichip.com/Documents/DataS ... FT232R.pdf on page 25 for how they show it being done.

earnestblimp wrote:Because you're not guaranteed to get more than 100ma unless you ask for it, according to the USB spec (and even then, I believe the request can be denied). So, even if it works 'most of the time', I would like to be certain that I'm requesting power the right way, so that when things go wrong, I can at least rule that out. Thanks


computers just connect the 5v to the power supply thru a polyswitch at best, so if you do overload it, then you lose power to all USB ports and the PS/2 ones on my motherboard as well.

Negotiation only matters when on a hub as that is all that will limit you to less than 500mA when you negotiate, and hubs usually just connect all the power pins together back to the cable to the PC, so even if you do abuse it, there is only the voltage drop of the hubs cable to really worry about. People have been abusing USB ports for a very long time with banned like coffee mug warmers and heated slippers, again, worst case, all USB ports lose power and you get that pop up telling you that it happened.

richms
 
Posts: 558
Joined: Tue Jan 20, 2009 3:05 am
Location: New Zealand

Re: Greater than 100 ma power negotiation

by earnestblimp on Fri Jun 18, 2010 10:11 am

There are other IO pins on the FDTI that are configurable in the windows software, but the default of one of them is to be sleep, another is PWREN which signals that you can turn on. Look here http://www.ftdichip.com/Documents/DataS ... FT232R.pdf on page 25 for how they show it being done.


Ah ok great. Do you know if I can read those pins from my Arduino code? I searched for quite some time for this information, and I couldn't find anything. I would love to find out whether or not FTDI pins were available for reading from sketch code in some way (even if they have to use lower-level code).

computers just connect the 5v to the power supply thru a polyswitch at best, so if you do overload it, then you lose power to all USB ports and the PS/2 ones on my motherboard as well.

Negotiation only matters when on a hub as that is all that will limit you to less than 500mA when you negotiate, and hubs usually just connect all the power pins together back to the cable to the PC, so even if you do abuse it, there is only the voltage drop of the hubs cable to really worry about. People have been abusing USB ports for a very long time with banned like coffee mug warmers and heated slippers, again, worst case, all USB ports lose power and you get that pop up telling you that it happened.


Hmm, well if that's the case, and I can ensure that my device is only ever directly connected to the computer, then maybe I have nothing to worry about. Thanks for the information!

earnestblimp
 
Posts: 19
Joined: Thu Sep 17, 2009 10:42 am

Re: Greater than 100 ma power negotiation

by richms on Fri Jun 18, 2010 8:44 pm

earnestblimp wrote:
Ah ok great. Do you know if I can read those pins from my Arduino code? I searched for quite some time for this information, and I couldn't find anything. I would love to find out whether or not FTDI pins were available for reading from sketch code in some way (even if they have to use lower-level code).


Not without connecting them up to the IO pins of the arduino. Once you do that they are just normal inputs you can read as you like

richms
 
Posts: 558
Joined: Tue Jan 20, 2009 3:05 am
Location: New Zealand

Re: Greater than 100 ma power negotiation

by chuckm on Fri Jun 18, 2010 10:46 pm

richms wrote:computers just connect the 5v to the power supply thru a polyswitch at best, so if you do overload it, then you lose power to all USB ports and the PS/2 ones on my motherboard as well.


This is a dangerously erroneous comment. I don't doubt that some computer at some time might have been designed this way but reputable systems are not. Real computers and real peripherals should negotiate power requirements, failing to do so should simply result in your computer powering off the USB port you are plugged into.

--Chuck

chuckm
 
Posts: 159
Joined: Thu Dec 24, 2009 3:31 am

Please be positive and constructive with your questions and comments.