Does anybody know how to control USB pins on a certain USB port? I think it is definately possible in assembler but what about C++ or C#?
I want to be able to use USB battery as a power supply for an LED or something like that. So then a program would power it on and power it off making it flash.
I know it sounds pointless but I need to do it for something awesome.
I also know that it might require a custom driver.
You can't simply toggle pins on a USB port. Period. USB is a serial protocol. The connector contains
If you want to get some IO ports you need more logic. You need at least something that follows the USB protocol, which means some kind of microcontroller (or a special USB device controller like the FTDI USB controllers. The FT232 and FT245 are especially nice to work with). For a low-end microcontroller based solution the V-USB driver for AVR controllers might be interesting.
For easy bit-banging IO pins on the PC use the parallel port. USB is really not made nor suited for that.
According to http://www.gniibe.org/development/ac-power-control-by-USB-hub/index
USB 2.0 nominally supports per-port power switching:
Hub Descriptor: [...] wHubCharacteristic 0x0089 Per-port power switching [...]
Sadly, the author reports that while may hubs' firmware claims to support this, the manufacturers have cut corners on the circuit board.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With