Hai Great Keil Forum Support Team.
How much currant could drive my USB port? Kindly advice to avoid damaged for the usb port..if I'm not wrong the Voltage around 5 VDC and 4 VDC.
Regards Jeckson
Indeed - but what should a conforming device do if it wants to continue in low-poewr mode after the host refuses its high-power request??
A USB Host seldom provides fractional power. Usually it's 100 mA for a low power device or 500 mA for a high power device. If the Window's driver detects an overload, it will dis-connect and re-enumeration is required.
A well defined device will drop the power to the pull-up resistors and then re-apply power to force a dis-connect and re-connect. Most Window USB drivers will flash a screen informing of the power overload.
The LPC2378 type devices can hold off the pull-up enable under software control to allow the power to intialize and settle before initiating enumeration. If the device can be operated in a lower power mode, then the decision could be made prior to the re-enumeration. Bradford
Yes, I can see that could be done - but my quesion was, what should be done?
What is the preferred approach to this?
> If the high-power negotiation fails, is the device considered to be configured as a low-power device?
No. When a device requests more than one unit load (100mA) on its config descriptor, bMaxPower field, and when Windows and Mac don't accept it, OS stop enumeration in half, and put power-supply overflow warning dialog. There is no way for the device to know the enumeration stops. Just custom device driver solves this problem.
Linux doesn't check config descriptor, and it allows ANY config.
Tsuneo
In addition to above post,
USB spec regulates that root hub (ie. PC USB port) and self-powered hub should supply five unit load (500 mA). Just bus-powered hub is limited to one unit load (100mA). Therefore, above accident occurs just on bus-powered hub.
Hub answers to host about its power supply status with GetStatus( DEVICE ) request from the host. But most of hubs on the market always answer to the inquiry as self-powered, even when it is actually bus-powered. Just hubs with "USB logo" obey the rule. Therefore, above situation doesn't occur so often in the real world.
In this reason, a custom device driver is rarely made to solve above problem. Manufacturers of high-power devices just write to their user's manual as follows, when user sees power-supply overflow warning dialog, connect the device to self-powered hub.