1
\$\begingroup\$

I make a USB MIDI device and am designing a new version. I'd like to have two micro-USB receptacles in different locations so that the user can choose either, for ergonomic reasons. The easiest thing seems to be to just wire both receptacles to the uC and supply a receptacle cover for the one that isn't being used, instructing the user to never plug a cable into both receptacles at once. I suspect that this isn't a "valid" approach. Is there an accepted way to do this?

\$\endgroup\$
3
  • \$\begingroup\$ have you considered one socket and two cable routing channels \$\endgroup\$
    – jsotola
    Commented Sep 29, 2021 at 15:26
  • 2
    \$\begingroup\$ What speed USB is this? Hanging two (spatially separated) ports off the same bus is going to do bad things at higher link speeds. \$\endgroup\$ Commented Sep 29, 2021 at 15:29
  • \$\begingroup\$ This is 2.0 full speed, and the two ports would actually be quite close to each other (about 1" apart, just on adjacent surfaces of the device. So, my hope was that it wouldn't affect the signal too much. \$\endgroup\$ Commented Nov 23, 2021 at 17:03

2 Answers 2

1
\$\begingroup\$

Using two sockets on the same bus seems like a poor idea, both because of signal integrity (each socket's routing ends up becoming a long stub when the other is in use) and the risk of hardware damage if someone does plug both ports in (especially if they share VBUS).

Instead, consider the use of a USB switch IC similar to the ones in the USB portion of KVM hubs (which do the same thing of fanning in multiple USB hosts to the same peripheral devices). An example IC for this (no endorsement for this device or its manufacturer) would be something like FSUSB30.

You should be able to play some tricks by detecting the VBUS of one line and using that as the select signal for the switch IC. This avoids the need to manually configure the port.

Of course, as mentioned in the comments, a mechanical design for a routing channel could allow cables to neatly exit a single port and then reach either side without making electrical changes or adding a device to your bill of materials.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Thanks! It's more the possible hardware damage that I'm worried about because the stubs would actually be pretty short. The FSUSB30 sounds like just what I need for this. Thanks for that suggestion! \$\endgroup\$ Commented Nov 23, 2021 at 17:05
0
\$\begingroup\$

You'll want an easy way to switch to using either data pair. In the easiest case, your microcontroller's IO matrix is flexible enough to route either one or another pair of pins to the internal USB PHY, or you have two USB PHYs.

Most MCUs don't have that. Instead, a very simple switch IC can be used, controlled by which of both USB ports has external VUSB plugged in, to mux.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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