3
\$\begingroup\$

I've got a board I'm working on that I think may have two USB ports and both of them could conceivably be connected to a computer at the same time. Both USB connectors need not be connected to the PC, but I'd like the board to be powered by USB from the PC when one or both of them is plugged in. Can I simply connect the 5V pins on both USB connectors together on my board to achieve this outcome? It's all the same 5V net on the PC internally anyway, right? If you don't think it's sound to connect 5V to 5V on different USB connectors, then please propose an alternative solution.

\$\endgroup\$
  • 1
    \$\begingroup\$ Can you elaborate more on your two-port device? \$\endgroup\$ – Adam Lawrence Aug 14 '12 at 2:44
  • \$\begingroup\$ @Madmanguruman sure one is to support an embedded USBTiny programmer and the other is to support an FT232R USB-UART bridge, but I don't think this is relevant to the question I'm asking... \$\endgroup\$ – vicatcu Aug 14 '12 at 2:53
  • \$\begingroup\$ I was mainly curious as to whether or not your device had one distinct function per connection. \$\endgroup\$ – Adam Lawrence Aug 14 '12 at 10:26
6
\$\begingroup\$

I think it's fine, and I'd just connect them.

However, if you want to be extra safe, note that some USB voltages can be quite a bit lower than others, due primarily to the drops in the current limiting devices in each hub. Or you could invent even stranger cases, like having one plugged into the end of a chain of bus-powered hubs, and the other plugged directly into a self-powered hub. Shorting the +5V signals together may end up causing current to flow backwards in some of the hubs, if one device's voltage is higher than the other. Active electronics, like hubs that support power switching, may be damaged by that.

Instead, you can connect each +5V through a diode to your +V rail on your circuit. Your circuit's +V would be dropped a bit (maybe 0.6V for a 1N4148 or similar diode), but the USBTiny and FT232R should likely both be OK with that.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ In this case, it may be best to use external power. I don't know if the USB spec clearly defines what to do with multiple powered host connections, if it's covered at all. \$\endgroup\$ – Adam Lawrence Aug 14 '12 at 10:29
  • 1
    \$\begingroup\$ If you're going to use diodes (which I agree should work), then use Schottky diodes to reduce the forward voltage. The VS-95SQ015 has a Vf of 0.2v at 250 ma. \$\endgroup\$ – tcrosley Aug 14 '12 at 18:04
1
\$\begingroup\$

Since your needs are for a USB serial converter and a custom embedded programmer, one very attractive solution could be to choose a slightly more capable USB microcontroller and implement both the custom programmer and USB-serial conversion in it. This will likely be more cost effective and save board space/complexity.

The virtual com port type of converter has gained a lot of popularity over the last few years, there is reference code for most USB micros.

A simple means of combination would be to have an input which puts the software in one mode or the other.

Another possibility would be to run the programmer off of the USB serial, or even get a dual USB-serial chip and use one channel of it.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Chris thanks for the suggestion, but I'm not prepared to take on the complexity of integrating dual purpose firmware and writing custom PC drivers to support it at this time. Using separate chips and ports allows me to take advantage of the existing software ecosystems surrounding these two solutions at the expense of the added hardware. It's a trade off. \$\endgroup\$ – vicatcu Aug 14 '12 at 18:01
0
\$\begingroup\$

If they are going to the same set of USB ports on a computer, it should be fine.

If however, one is going to an onboard USB port and one is going to a USB hub, there may be a difference in voltage between them that can cause problems.

If there is any chance each port could be going to different computers, it could really cause problems, as the two computers might not be at the same ground potential and you are connecting their power supplies to each other.

| improve this answer | |
\$\endgroup\$

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.