tags:

views:

1183

answers:

5

I have a device that came with an AC power adapter where the connector is a mini USB plug. The device however doesn't seem to power itself from a computer's USB port (using a standard USB-mini USB cable) unless a specific driver is installed. The driver is only available for Windows. I would like to charge the device from USB plugs on different platforms.

My question is: why isn't power getting to the device without the driver? Is a driver always required for a USB port to start giving power? Or is it this device that's specifically made not to take a charge unless some software routine triggers it to do so?

I guess my question can be summarized as: Is power not present on the USB cable or is it present but the device ignoring it. If the answer is the former, I'll be trying to figure out how to write software that will enable the voltage to always be present.

Thanks

+1  A: 

Have you tried plugging it into a 'dumb' USB port - like the one on a car charger? Those ports are pure power and don't create a USB network. I think.

Aric TenEyck
So this means that when I connect a device on a PC, USB will only offer the constant voltage once the kernel can talk to the device?
Mr Grieves
I don't know, but I don't think so. I've plugged devices in that didn't talk to the kernel and seen them getting power. It might depend on your motherboard, OS, BIOS, phase-of-the-moon, or something else.
Aric TenEyck
A: 

Unless you have the hardware specs from the manufacturer, I think you are out of luck. You could try reverse engineering the driver to see what it does, but I'd expect it would be cheaper and easier just to buy one with cross platform drivers or charges without the driver.

Byron Whitlock
+2  A: 

This seems to be platform-specific. In Linux, USB ports are always energized, while on Windows they don't. Thumbdrives with LEDs turn off when unmounted in windows, but in Linux they stay lit. My cellphone's manual says that it can't be charged by a PC, but I regularly do on my linux machine, I guess that's because they don't have a driver and windows won't power up without one.

Javier
How can you regularly charge on your windows machine if window won't power up without a driver?
Mr Grieves
oops! i meant linux machine. (editing...)
Javier
+13  A: 

Why isn't power getting to the device without the driver?

USB ports are always powered when the computer is on and the USB control software hasn't detected current overdraw.

Is a driver always required for a USB port to start giving power?

No, the USB port is always required to start off providing power to the device, otherwise the device could never initiate a connection.

Or is it this device that's specifically made not to take a charge unless some software routine triggers it to do so?

This can be complex. To meet the USB spec a device cannot pull more than a few mA until it's registered with the computer.

However, nearly every computer allows the USB port to pull the full 500mA (and more) before it'll shut the power off.

The device you're charging is being nice by not pulling any significant power until the computer gives permission.

Writing software won't help, the device has to register with the USB bus, which will best be done with the driver.

However, the plug in charger doesn't do that. It likely has shorted the two data lines of the USB plug together, which signals the USB device that it's not connected to a computer and can pull the full 500mA without waiting.

Take a USB extension cable, cut off the jacket, and short the data lines (green and yellow, sometimes) together on the end going to the USB device, and leave them cut without touching anything on the end going to the PC, and leave the read and black power wires connected through.

It might work. If not, take the wall charger apart and find out what it's doing with each of the four USB wires, and see if you can duplicate that.

Adam Davis
Two other possible cable wiring patterns are no connection at all to the data wires, and specific bias resistors on the data wires. But the USB Battery Charging Specification calls for the upstream port to short the data wires and nearly all new cell phones support that standard so a cable with the white and green wires shorted on the phone's end (and unconnected on the PC end) is likely to do the trick. It won't be kind to a laptop battery, however.
RBerteig
"Writing software won't help ... "best be done with the driver"A driver is just software. So Mr Grieves can help himself by writing software. It shouldn't even be necessary to write a potentially scary low-level kernel driver. Albinofrenchy's post points to how to put a USB device into the mode where the controller sends it 500mA (the max specified) from userspace in Linux.
tialaramex