|
|
View previous topic :: View next topic |
Author |
Message |
DragonPIC
Joined: 11 Nov 2003 Posts: 118
|
USB Power - Request more current |
Posted: Wed Aug 03, 2011 8:50 am |
|
|
Been looking over some articles about USB 2.0 and found that a host will supply 500mA of current to connected devices. It also says that this current may be requested by a "high-power" device. Is this something I must do within my PIC code or is this automatically handled in the CCS USB library/driver somehow? Using the PIC18F26J50.
Thanks,
Matt _________________ -Matt |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19477
|
|
Posted: Wed Aug 03, 2011 9:13 am |
|
|
In the descriptor files. Look for the setting 'USB_CONFIG_BUS_POWER'. Default is 100 (100mA). You can set it yourself to a higher value _before_ loading the descriptor, and this higher value will be used.
Beware of relying on too much power here though. Though USB should be able to deliver 500mA, if (for instance), you attach via an unpowered hub, the 500mA, is the maximum _total_ for all devices attached to this hub, and the hub itself.
Best Wishes |
|
|
DragonPIC
Joined: 11 Nov 2003 Posts: 118
|
Thanks |
Posted: Wed Aug 03, 2011 12:51 pm |
|
|
Thanks. Is there a way to tell if the request was made successfully? I think I seen a snoopy program on one of the forum posts.
-Matt _________________ -Matt |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19477
|
|
Posted: Thu Aug 04, 2011 10:37 am |
|
|
Not really.
Problem is that power management is only 'partial'. The ports normally have something akin to a self resetting fuse, limiting the current to 500mA, but nothing to limit the current below this. So a lot of devices will just attach, and take what they need, without 'telling' the host this. This is how you can have USB charging cables that are not seen as USB devices at all. Further, many hubs have less power available than they require (so you have multi port USB hubs, with - say - a 1A supply). As far as the host is concerned they can deliver the power, but if all the attached devices actually drew 500mA, the supply would probably shut down..... In this latter case, it would be seen, since the devices already attached would suddenly disconnect. Generally, if the enumeration is successful, and your supply voltage is stable and perhaps >4.5v, then the power is there.
On 'well behaved' setups, say the port on a laptop, with good power management, the OS will normally put up an error box reporting that the power was not available, if a device requests more current than the unit can supply.
Best Wishes |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|