1

I have an equipment that communicates through a COM port and it is powered by the USB port. My problem is that when the PC reboots, the power is kept but the communication with the COM port stops. The only way to restart is to remove and insert the USB cable.

I'm developing a Delphi application that turns off the USB power. I tried using devcon to do it:

devcon.exe disable *ID*
devcon.exe enable *ID*
devcon.exe restarts *ID*

But it only stops the communication with the COM port. The USB power is kept.

Is there a way to power off the USB port, so the equipment would also turn off?

Any tip will be very helpful.

  • Also, please identify the computers. – fixer1234 Sep 5 '16 at 19:44
  • Yes, I'll do it as part of the PC reboot process. My only problem is that devcon is not turning off the power of the USB. The equipment is connected by a PL2303 USB-TTL converter. – marcosbontempo Sep 5 '16 at 19:52
0

For most PCs the USB VBUS power on ROOT ports does not have any high-side hardware switches to control VBUS, thus there is no means to turn the VBUS on/off by software. The VBUS is connected nearly directly to system's PS, to +5VSB (standby) rail, so even if the PC is turned off, VBUS stays. This is done this way so a keyboard or mouse can wake the PC up. (Laptops are somewhat different, it depends). Therefore, you have three options:

(1) Use a good (certified and expensive) hub with ports that have high-side switches to connect to your COM devices. When PC reboots, new enumeration cycle for USB hub will have USB_RESET state, and high-side switches will turn off and then on. It might be not easy to find this kind of hub, since manufacturers usually have stuffing options on their PCBs either to use high-side switches (adding cost), or bypass them with resettable polyfuse (cheap) at assembly point.

(2) Use a separate controlled power source like this SPDT USB-controlled switch between USB port and your equipment.

(3) Fix your COM-port equipment and/or host driver to implement "reset/initialize" protocol.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.