PDA

View Full Version : Turn off “USB toot hub”/device power



tanffn
19-12-2006, 02:16 PM
The title says it all, I want to find a way to turn off the power of a USB device (and do it in code).
Sadly I have no idea where to start looking :cry:

After some googleing I found this post:
http://forums.bit-tech.net/showthread.php?t=101247
But he eventually gave up and used a relay.

cronodragon
19-12-2006, 03:03 PM
What do you mean with turn off th power? Send a signal to a given device, like a printer to turn itself off, or set a signal to the USB port to stop feeding current?

tanffn
19-12-2006, 05:39 PM
Send a signal to the USB hub controller to shot down the power to the devices.

In the USB spec it said that the hub can decide if it can supply power to the device or not and it can even “punish” a device that consumes more then it stated it will be using.
If you go to the “device manager”, select one of your “USB Root Hub”, properties, power management, you can see a chackbox that says “allow the computer to turn off this device to save power” => it can be done. Now how..?

cronodragon
20-12-2006, 02:17 PM
I have made HID circuits, but nothing like that. Some micros have a low power mode that you can program, I don't know if that helps.

From what I have read that option you said is for energy saving in laptops, and is used by the system only (maybe BIOS?). :?

JernejL
20-12-2006, 03:32 PM
it is probably part of APM / ACPI interface.

JSoftware
20-12-2006, 08:03 PM
I looked a bit on it yesterday and according to my research you would have to use the ddk to interface to the usb ports

tanffn
21-12-2006, 08:49 AM
Thank you guys for the help, I also ended up thinking about the DDK:
http://msdn2.microsoft.com/en-us/library/aa476217.aspx

I purchase it few years back (~50 US$ for the CD), and I never received it.. I’ll probably have to buy it again :(
Unless any of you guys have an idea how to use/accesses the DDK functions using Delphi?

EDIT: It looks like its now possible to download the iso from M$ site (230MB) and even buy the CD(s) for 0.00US$

JSoftware
21-12-2006, 09:02 AM
I've tried and did get the usb part to work somewhat. I had to read a bunch of packets using some ioctl. I only managed to get it to read one though.

I haven't found any delphi ports of the ddk so you'll have to port it yourself or port the parts you'll have to use.

Edit: you can get the c++ headers with mingw etc.

tanffn
21-12-2006, 02:34 PM
Burned the iso to a cd, I’ll install it at home (I have VS6 there) and see how it goes..