USB device with 2 ports - how to protect against user plugging in both

Clash Royale CLAN TAG#URR8PPP
up vote
11
down vote
favorite
I've got a Full speed USB device which I want to provide 2 ports for - one each on opposite ends of the enclosure. This is so the cable can be connected wherever is most convenient. My MCU (atmega32u4) has only one interface, so the physical ports will shared, but only one should be plugged in at one time.
Of course users can't be trusted to not plug in both sides at once. How to protect against this?
Ideas I've come up with:
- Just wire them up "as-is" and hope the host can deal with joined D+/D- pins
- NAND gate with separate 5V pins as input, output to a MOSFET that disconnects Vcc when both are plugged in.
Does the second option sound reasonable, or is a more complex solution required?
protection usb-device
add a comment |Â
up vote
11
down vote
favorite
I've got a Full speed USB device which I want to provide 2 ports for - one each on opposite ends of the enclosure. This is so the cable can be connected wherever is most convenient. My MCU (atmega32u4) has only one interface, so the physical ports will shared, but only one should be plugged in at one time.
Of course users can't be trusted to not plug in both sides at once. How to protect against this?
Ideas I've come up with:
- Just wire them up "as-is" and hope the host can deal with joined D+/D- pins
- NAND gate with separate 5V pins as input, output to a MOSFET that disconnects Vcc when both are plugged in.
Does the second option sound reasonable, or is a more complex solution required?
protection usb-device
How do you propose wiring the two ports to connect D+ and D- together? You should add a diagram explaining the layout you propose.
â Solar Mike
Sep 16 at 7:23
@SolarMike Shared between the two - in the "correct" scenario, with only one cable connected, the other connector's D+/D- will be left dangling.
â monty
Sep 16 at 8:58
7
You should also consider designing the case with a moving cover so that only one usb port is exposed at once. That way you clearly communicate to the user that they are only allowed to plug in to one of the ports at once instead of confusing them when they plug in two hosts and one doesn't work.
â Nonny Moose
Sep 16 at 13:48
3
don't forget about the user who manages to find a male-male usb cable and plugs the device into itself !!!
â RozzA
Sep 16 at 21:59
add a comment |Â
up vote
11
down vote
favorite
up vote
11
down vote
favorite
I've got a Full speed USB device which I want to provide 2 ports for - one each on opposite ends of the enclosure. This is so the cable can be connected wherever is most convenient. My MCU (atmega32u4) has only one interface, so the physical ports will shared, but only one should be plugged in at one time.
Of course users can't be trusted to not plug in both sides at once. How to protect against this?
Ideas I've come up with:
- Just wire them up "as-is" and hope the host can deal with joined D+/D- pins
- NAND gate with separate 5V pins as input, output to a MOSFET that disconnects Vcc when both are plugged in.
Does the second option sound reasonable, or is a more complex solution required?
protection usb-device
I've got a Full speed USB device which I want to provide 2 ports for - one each on opposite ends of the enclosure. This is so the cable can be connected wherever is most convenient. My MCU (atmega32u4) has only one interface, so the physical ports will shared, but only one should be plugged in at one time.
Of course users can't be trusted to not plug in both sides at once. How to protect against this?
Ideas I've come up with:
- Just wire them up "as-is" and hope the host can deal with joined D+/D- pins
- NAND gate with separate 5V pins as input, output to a MOSFET that disconnects Vcc when both are plugged in.
Does the second option sound reasonable, or is a more complex solution required?
protection usb-device
protection usb-device
edited Sep 16 at 9:13
asked Sep 16 at 6:57
monty
13019
13019
How do you propose wiring the two ports to connect D+ and D- together? You should add a diagram explaining the layout you propose.
â Solar Mike
Sep 16 at 7:23
@SolarMike Shared between the two - in the "correct" scenario, with only one cable connected, the other connector's D+/D- will be left dangling.
â monty
Sep 16 at 8:58
7
You should also consider designing the case with a moving cover so that only one usb port is exposed at once. That way you clearly communicate to the user that they are only allowed to plug in to one of the ports at once instead of confusing them when they plug in two hosts and one doesn't work.
â Nonny Moose
Sep 16 at 13:48
3
don't forget about the user who manages to find a male-male usb cable and plugs the device into itself !!!
â RozzA
Sep 16 at 21:59
add a comment |Â
How do you propose wiring the two ports to connect D+ and D- together? You should add a diagram explaining the layout you propose.
â Solar Mike
Sep 16 at 7:23
@SolarMike Shared between the two - in the "correct" scenario, with only one cable connected, the other connector's D+/D- will be left dangling.
â monty
Sep 16 at 8:58
7
You should also consider designing the case with a moving cover so that only one usb port is exposed at once. That way you clearly communicate to the user that they are only allowed to plug in to one of the ports at once instead of confusing them when they plug in two hosts and one doesn't work.
â Nonny Moose
Sep 16 at 13:48
3
don't forget about the user who manages to find a male-male usb cable and plugs the device into itself !!!
â RozzA
Sep 16 at 21:59
How do you propose wiring the two ports to connect D+ and D- together? You should add a diagram explaining the layout you propose.
â Solar Mike
Sep 16 at 7:23
How do you propose wiring the two ports to connect D+ and D- together? You should add a diagram explaining the layout you propose.
â Solar Mike
Sep 16 at 7:23
@SolarMike Shared between the two - in the "correct" scenario, with only one cable connected, the other connector's D+/D- will be left dangling.
â monty
Sep 16 at 8:58
@SolarMike Shared between the two - in the "correct" scenario, with only one cable connected, the other connector's D+/D- will be left dangling.
â monty
Sep 16 at 8:58
7
7
You should also consider designing the case with a moving cover so that only one usb port is exposed at once. That way you clearly communicate to the user that they are only allowed to plug in to one of the ports at once instead of confusing them when they plug in two hosts and one doesn't work.
â Nonny Moose
Sep 16 at 13:48
You should also consider designing the case with a moving cover so that only one usb port is exposed at once. That way you clearly communicate to the user that they are only allowed to plug in to one of the ports at once instead of confusing them when they plug in two hosts and one doesn't work.
â Nonny Moose
Sep 16 at 13:48
3
3
don't forget about the user who manages to find a male-male usb cable and plugs the device into itself !!!
â RozzA
Sep 16 at 21:59
don't forget about the user who manages to find a male-male usb cable and plugs the device into itself !!!
â RozzA
Sep 16 at 21:59
add a comment |Â
5 Answers
5
active
oldest
votes
up vote
22
down vote
accepted
As pointed out, you can't directly connect two hosts to a device - so if you just wired them together and somebody plugged it in on both ends, you'd have a problem.
However you also have a problem if only one end is plugged in. USB, especially high-speed (480Mbps) mode is controlled impedance. If you wire both connectors data lines together you end up with what is known as a stub in high frequency design. The cable going to the unused connector will degrade the performance of the active connector.
To do this properly, you want a multiplexer IC. You can buy dedicated USB2.0 multiplexers designed specifically for this sort of application - something like the TS3USB30. That would allow you to connect the data lines from both ports to the mux inputs, and connect the output to your device internally. The mux will disconnect the unused connector which will disconnect the transmission line stubs.
For power I would probably use a power multiplexer such as a diode OR-ing circuit. The VBUS line from one of the ports (before the power multiplexer) can then be used as the input to the data multiplexer.
Ground would be common (connected) between the two USB ports and your device.
1
I didn't consider the stubs - that multiplexer (combined with power multiplex) looks ideal!
â monty
Sep 16 at 9:16
3
Stubs shouldn't be a problem at Full Speed, which is all you asked about in your question.
â Dave Tweedâ¦
Sep 16 at 12:45
1
@DaveTweed I added the Full Speed clarification after I realised this answer covered High Speed. Knowing I can "get away with it" is good for this design, but I definitely appreciate knowing the implications at higher speeds.
â monty
Sep 16 at 15:08
Now I'm genuinely interested how to make atmega32u4 support 480Mbps :)
â Dmitry Grigoryev
Sep 17 at 7:15
add a comment |Â
up vote
9
down vote
Multiplexer as suggested by Tom Carpenter is a good solution.
But for full speed USB (12 Mbps), the stubs in the signals are not particularly important. If the distance between the stub ends remain below 1/10th of wavelength, i.e. below ~2 meters, the reflections will not distort the waveform much.
Also, the voltage levels on D+ and D- pins will remain within the acceptable range, so there is not much risk of electronic damage to either host.
The main problem that remains is if you connect the +5V pins from both hosts together, there could be large currents involved. You could use a diode from each USB connector's +5V pin to only let current come in, never out.
add a comment |Â
up vote
3
down vote
The lazy electronical design way would just be to use a physical multi connector switch to choose between which one is used.
Note that this would have the added benefit of being able to leave them both plugged in and use the switch to select which input is to be used.
add a comment |Â
up vote
2
down vote
There is no USB compliant way of doing this. USB is not designed to be shared between two hosts and attempting to do so will lead to potentially disastrous situations.
At best, you can use a USB multiplexer or switch IC, with GPIO to determine which connector is connected. You'll have to decide which USB connection has precedence, because both cannot be connected to your USB interface at the same time.
Or look at alternatives. Have one computer communicate to the other. Or use Bluetooth or use Wi-Fi or a different connection type.
I've added clarification to the question - only one port will ever be used at once, and (hopefully) the NAND gate can solve the precedence issue by simple denying the "both plugged in" scenario.
â monty
Sep 16 at 8:56
What kind of disastrous situations do you think it could lead to?
â jpa
Sep 16 at 11:59
1
@jpa suppose the two systems have "ground" potentials that are 50V different, for example. Connecting them both to D- could be "interesting". Even if the potentials are only 50mV different, you may have created a noise-generating "ground loop".
â alephzero
Sep 16 at 13:07
@alephzero Sure, but even a typical multiplexer or switch IC wouldn't handle that. The ground connecting first in USB connector, however, mostly eliminates that problem.
â jpa
Sep 16 at 14:14
add a comment |Â
up vote
0
down vote
Perhaps it would be easier to leave the USB connector at one side of the enclosure and duplicate and / or relocate all other user-facing elements symmetrically. Then the enclosure can be rotated so that the USB port is facing the connector, while all other elements are still conveniently accessible.
Another option is to locate both ports on one side of the enclosure (at the opposite ends) and add a sliding stub inside the enclose which the user can move to open one port or the other. 12 MHz USB has a good chance of working with an extra disconnected port attached to it.
add a comment |Â
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
22
down vote
accepted
As pointed out, you can't directly connect two hosts to a device - so if you just wired them together and somebody plugged it in on both ends, you'd have a problem.
However you also have a problem if only one end is plugged in. USB, especially high-speed (480Mbps) mode is controlled impedance. If you wire both connectors data lines together you end up with what is known as a stub in high frequency design. The cable going to the unused connector will degrade the performance of the active connector.
To do this properly, you want a multiplexer IC. You can buy dedicated USB2.0 multiplexers designed specifically for this sort of application - something like the TS3USB30. That would allow you to connect the data lines from both ports to the mux inputs, and connect the output to your device internally. The mux will disconnect the unused connector which will disconnect the transmission line stubs.
For power I would probably use a power multiplexer such as a diode OR-ing circuit. The VBUS line from one of the ports (before the power multiplexer) can then be used as the input to the data multiplexer.
Ground would be common (connected) between the two USB ports and your device.
1
I didn't consider the stubs - that multiplexer (combined with power multiplex) looks ideal!
â monty
Sep 16 at 9:16
3
Stubs shouldn't be a problem at Full Speed, which is all you asked about in your question.
â Dave Tweedâ¦
Sep 16 at 12:45
1
@DaveTweed I added the Full Speed clarification after I realised this answer covered High Speed. Knowing I can "get away with it" is good for this design, but I definitely appreciate knowing the implications at higher speeds.
â monty
Sep 16 at 15:08
Now I'm genuinely interested how to make atmega32u4 support 480Mbps :)
â Dmitry Grigoryev
Sep 17 at 7:15
add a comment |Â
up vote
22
down vote
accepted
As pointed out, you can't directly connect two hosts to a device - so if you just wired them together and somebody plugged it in on both ends, you'd have a problem.
However you also have a problem if only one end is plugged in. USB, especially high-speed (480Mbps) mode is controlled impedance. If you wire both connectors data lines together you end up with what is known as a stub in high frequency design. The cable going to the unused connector will degrade the performance of the active connector.
To do this properly, you want a multiplexer IC. You can buy dedicated USB2.0 multiplexers designed specifically for this sort of application - something like the TS3USB30. That would allow you to connect the data lines from both ports to the mux inputs, and connect the output to your device internally. The mux will disconnect the unused connector which will disconnect the transmission line stubs.
For power I would probably use a power multiplexer such as a diode OR-ing circuit. The VBUS line from one of the ports (before the power multiplexer) can then be used as the input to the data multiplexer.
Ground would be common (connected) between the two USB ports and your device.
1
I didn't consider the stubs - that multiplexer (combined with power multiplex) looks ideal!
â monty
Sep 16 at 9:16
3
Stubs shouldn't be a problem at Full Speed, which is all you asked about in your question.
â Dave Tweedâ¦
Sep 16 at 12:45
1
@DaveTweed I added the Full Speed clarification after I realised this answer covered High Speed. Knowing I can "get away with it" is good for this design, but I definitely appreciate knowing the implications at higher speeds.
â monty
Sep 16 at 15:08
Now I'm genuinely interested how to make atmega32u4 support 480Mbps :)
â Dmitry Grigoryev
Sep 17 at 7:15
add a comment |Â
up vote
22
down vote
accepted
up vote
22
down vote
accepted
As pointed out, you can't directly connect two hosts to a device - so if you just wired them together and somebody plugged it in on both ends, you'd have a problem.
However you also have a problem if only one end is plugged in. USB, especially high-speed (480Mbps) mode is controlled impedance. If you wire both connectors data lines together you end up with what is known as a stub in high frequency design. The cable going to the unused connector will degrade the performance of the active connector.
To do this properly, you want a multiplexer IC. You can buy dedicated USB2.0 multiplexers designed specifically for this sort of application - something like the TS3USB30. That would allow you to connect the data lines from both ports to the mux inputs, and connect the output to your device internally. The mux will disconnect the unused connector which will disconnect the transmission line stubs.
For power I would probably use a power multiplexer such as a diode OR-ing circuit. The VBUS line from one of the ports (before the power multiplexer) can then be used as the input to the data multiplexer.
Ground would be common (connected) between the two USB ports and your device.
As pointed out, you can't directly connect two hosts to a device - so if you just wired them together and somebody plugged it in on both ends, you'd have a problem.
However you also have a problem if only one end is plugged in. USB, especially high-speed (480Mbps) mode is controlled impedance. If you wire both connectors data lines together you end up with what is known as a stub in high frequency design. The cable going to the unused connector will degrade the performance of the active connector.
To do this properly, you want a multiplexer IC. You can buy dedicated USB2.0 multiplexers designed specifically for this sort of application - something like the TS3USB30. That would allow you to connect the data lines from both ports to the mux inputs, and connect the output to your device internally. The mux will disconnect the unused connector which will disconnect the transmission line stubs.
For power I would probably use a power multiplexer such as a diode OR-ing circuit. The VBUS line from one of the ports (before the power multiplexer) can then be used as the input to the data multiplexer.
Ground would be common (connected) between the two USB ports and your device.
edited Sep 16 at 9:16
answered Sep 16 at 9:10
Tom Carpenter
36.2k263108
36.2k263108
1
I didn't consider the stubs - that multiplexer (combined with power multiplex) looks ideal!
â monty
Sep 16 at 9:16
3
Stubs shouldn't be a problem at Full Speed, which is all you asked about in your question.
â Dave Tweedâ¦
Sep 16 at 12:45
1
@DaveTweed I added the Full Speed clarification after I realised this answer covered High Speed. Knowing I can "get away with it" is good for this design, but I definitely appreciate knowing the implications at higher speeds.
â monty
Sep 16 at 15:08
Now I'm genuinely interested how to make atmega32u4 support 480Mbps :)
â Dmitry Grigoryev
Sep 17 at 7:15
add a comment |Â
1
I didn't consider the stubs - that multiplexer (combined with power multiplex) looks ideal!
â monty
Sep 16 at 9:16
3
Stubs shouldn't be a problem at Full Speed, which is all you asked about in your question.
â Dave Tweedâ¦
Sep 16 at 12:45
1
@DaveTweed I added the Full Speed clarification after I realised this answer covered High Speed. Knowing I can "get away with it" is good for this design, but I definitely appreciate knowing the implications at higher speeds.
â monty
Sep 16 at 15:08
Now I'm genuinely interested how to make atmega32u4 support 480Mbps :)
â Dmitry Grigoryev
Sep 17 at 7:15
1
1
I didn't consider the stubs - that multiplexer (combined with power multiplex) looks ideal!
â monty
Sep 16 at 9:16
I didn't consider the stubs - that multiplexer (combined with power multiplex) looks ideal!
â monty
Sep 16 at 9:16
3
3
Stubs shouldn't be a problem at Full Speed, which is all you asked about in your question.
â Dave Tweedâ¦
Sep 16 at 12:45
Stubs shouldn't be a problem at Full Speed, which is all you asked about in your question.
â Dave Tweedâ¦
Sep 16 at 12:45
1
1
@DaveTweed I added the Full Speed clarification after I realised this answer covered High Speed. Knowing I can "get away with it" is good for this design, but I definitely appreciate knowing the implications at higher speeds.
â monty
Sep 16 at 15:08
@DaveTweed I added the Full Speed clarification after I realised this answer covered High Speed. Knowing I can "get away with it" is good for this design, but I definitely appreciate knowing the implications at higher speeds.
â monty
Sep 16 at 15:08
Now I'm genuinely interested how to make atmega32u4 support 480Mbps :)
â Dmitry Grigoryev
Sep 17 at 7:15
Now I'm genuinely interested how to make atmega32u4 support 480Mbps :)
â Dmitry Grigoryev
Sep 17 at 7:15
add a comment |Â
up vote
9
down vote
Multiplexer as suggested by Tom Carpenter is a good solution.
But for full speed USB (12 Mbps), the stubs in the signals are not particularly important. If the distance between the stub ends remain below 1/10th of wavelength, i.e. below ~2 meters, the reflections will not distort the waveform much.
Also, the voltage levels on D+ and D- pins will remain within the acceptable range, so there is not much risk of electronic damage to either host.
The main problem that remains is if you connect the +5V pins from both hosts together, there could be large currents involved. You could use a diode from each USB connector's +5V pin to only let current come in, never out.
add a comment |Â
up vote
9
down vote
Multiplexer as suggested by Tom Carpenter is a good solution.
But for full speed USB (12 Mbps), the stubs in the signals are not particularly important. If the distance between the stub ends remain below 1/10th of wavelength, i.e. below ~2 meters, the reflections will not distort the waveform much.
Also, the voltage levels on D+ and D- pins will remain within the acceptable range, so there is not much risk of electronic damage to either host.
The main problem that remains is if you connect the +5V pins from both hosts together, there could be large currents involved. You could use a diode from each USB connector's +5V pin to only let current come in, never out.
add a comment |Â
up vote
9
down vote
up vote
9
down vote
Multiplexer as suggested by Tom Carpenter is a good solution.
But for full speed USB (12 Mbps), the stubs in the signals are not particularly important. If the distance between the stub ends remain below 1/10th of wavelength, i.e. below ~2 meters, the reflections will not distort the waveform much.
Also, the voltage levels on D+ and D- pins will remain within the acceptable range, so there is not much risk of electronic damage to either host.
The main problem that remains is if you connect the +5V pins from both hosts together, there could be large currents involved. You could use a diode from each USB connector's +5V pin to only let current come in, never out.
Multiplexer as suggested by Tom Carpenter is a good solution.
But for full speed USB (12 Mbps), the stubs in the signals are not particularly important. If the distance between the stub ends remain below 1/10th of wavelength, i.e. below ~2 meters, the reflections will not distort the waveform much.
Also, the voltage levels on D+ and D- pins will remain within the acceptable range, so there is not much risk of electronic damage to either host.
The main problem that remains is if you connect the +5V pins from both hosts together, there could be large currents involved. You could use a diode from each USB connector's +5V pin to only let current come in, never out.
answered Sep 16 at 11:58
jpa
1,384611
1,384611
add a comment |Â
add a comment |Â
up vote
3
down vote
The lazy electronical design way would just be to use a physical multi connector switch to choose between which one is used.
Note that this would have the added benefit of being able to leave them both plugged in and use the switch to select which input is to be used.
add a comment |Â
up vote
3
down vote
The lazy electronical design way would just be to use a physical multi connector switch to choose between which one is used.
Note that this would have the added benefit of being able to leave them both plugged in and use the switch to select which input is to be used.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
The lazy electronical design way would just be to use a physical multi connector switch to choose between which one is used.
Note that this would have the added benefit of being able to leave them both plugged in and use the switch to select which input is to be used.
The lazy electronical design way would just be to use a physical multi connector switch to choose between which one is used.
Note that this would have the added benefit of being able to leave them both plugged in and use the switch to select which input is to be used.
answered Sep 17 at 4:48
Lassi Kinnunen
1311
1311
add a comment |Â
add a comment |Â
up vote
2
down vote
There is no USB compliant way of doing this. USB is not designed to be shared between two hosts and attempting to do so will lead to potentially disastrous situations.
At best, you can use a USB multiplexer or switch IC, with GPIO to determine which connector is connected. You'll have to decide which USB connection has precedence, because both cannot be connected to your USB interface at the same time.
Or look at alternatives. Have one computer communicate to the other. Or use Bluetooth or use Wi-Fi or a different connection type.
I've added clarification to the question - only one port will ever be used at once, and (hopefully) the NAND gate can solve the precedence issue by simple denying the "both plugged in" scenario.
â monty
Sep 16 at 8:56
What kind of disastrous situations do you think it could lead to?
â jpa
Sep 16 at 11:59
1
@jpa suppose the two systems have "ground" potentials that are 50V different, for example. Connecting them both to D- could be "interesting". Even if the potentials are only 50mV different, you may have created a noise-generating "ground loop".
â alephzero
Sep 16 at 13:07
@alephzero Sure, but even a typical multiplexer or switch IC wouldn't handle that. The ground connecting first in USB connector, however, mostly eliminates that problem.
â jpa
Sep 16 at 14:14
add a comment |Â
up vote
2
down vote
There is no USB compliant way of doing this. USB is not designed to be shared between two hosts and attempting to do so will lead to potentially disastrous situations.
At best, you can use a USB multiplexer or switch IC, with GPIO to determine which connector is connected. You'll have to decide which USB connection has precedence, because both cannot be connected to your USB interface at the same time.
Or look at alternatives. Have one computer communicate to the other. Or use Bluetooth or use Wi-Fi or a different connection type.
I've added clarification to the question - only one port will ever be used at once, and (hopefully) the NAND gate can solve the precedence issue by simple denying the "both plugged in" scenario.
â monty
Sep 16 at 8:56
What kind of disastrous situations do you think it could lead to?
â jpa
Sep 16 at 11:59
1
@jpa suppose the two systems have "ground" potentials that are 50V different, for example. Connecting them both to D- could be "interesting". Even if the potentials are only 50mV different, you may have created a noise-generating "ground loop".
â alephzero
Sep 16 at 13:07
@alephzero Sure, but even a typical multiplexer or switch IC wouldn't handle that. The ground connecting first in USB connector, however, mostly eliminates that problem.
â jpa
Sep 16 at 14:14
add a comment |Â
up vote
2
down vote
up vote
2
down vote
There is no USB compliant way of doing this. USB is not designed to be shared between two hosts and attempting to do so will lead to potentially disastrous situations.
At best, you can use a USB multiplexer or switch IC, with GPIO to determine which connector is connected. You'll have to decide which USB connection has precedence, because both cannot be connected to your USB interface at the same time.
Or look at alternatives. Have one computer communicate to the other. Or use Bluetooth or use Wi-Fi or a different connection type.
There is no USB compliant way of doing this. USB is not designed to be shared between two hosts and attempting to do so will lead to potentially disastrous situations.
At best, you can use a USB multiplexer or switch IC, with GPIO to determine which connector is connected. You'll have to decide which USB connection has precedence, because both cannot be connected to your USB interface at the same time.
Or look at alternatives. Have one computer communicate to the other. Or use Bluetooth or use Wi-Fi or a different connection type.
edited Sep 16 at 20:15
Peter Mortensen
1,56131422
1,56131422
answered Sep 16 at 7:29
Passerby
54.3k448142
54.3k448142
I've added clarification to the question - only one port will ever be used at once, and (hopefully) the NAND gate can solve the precedence issue by simple denying the "both plugged in" scenario.
â monty
Sep 16 at 8:56
What kind of disastrous situations do you think it could lead to?
â jpa
Sep 16 at 11:59
1
@jpa suppose the two systems have "ground" potentials that are 50V different, for example. Connecting them both to D- could be "interesting". Even if the potentials are only 50mV different, you may have created a noise-generating "ground loop".
â alephzero
Sep 16 at 13:07
@alephzero Sure, but even a typical multiplexer or switch IC wouldn't handle that. The ground connecting first in USB connector, however, mostly eliminates that problem.
â jpa
Sep 16 at 14:14
add a comment |Â
I've added clarification to the question - only one port will ever be used at once, and (hopefully) the NAND gate can solve the precedence issue by simple denying the "both plugged in" scenario.
â monty
Sep 16 at 8:56
What kind of disastrous situations do you think it could lead to?
â jpa
Sep 16 at 11:59
1
@jpa suppose the two systems have "ground" potentials that are 50V different, for example. Connecting them both to D- could be "interesting". Even if the potentials are only 50mV different, you may have created a noise-generating "ground loop".
â alephzero
Sep 16 at 13:07
@alephzero Sure, but even a typical multiplexer or switch IC wouldn't handle that. The ground connecting first in USB connector, however, mostly eliminates that problem.
â jpa
Sep 16 at 14:14
I've added clarification to the question - only one port will ever be used at once, and (hopefully) the NAND gate can solve the precedence issue by simple denying the "both plugged in" scenario.
â monty
Sep 16 at 8:56
I've added clarification to the question - only one port will ever be used at once, and (hopefully) the NAND gate can solve the precedence issue by simple denying the "both plugged in" scenario.
â monty
Sep 16 at 8:56
What kind of disastrous situations do you think it could lead to?
â jpa
Sep 16 at 11:59
What kind of disastrous situations do you think it could lead to?
â jpa
Sep 16 at 11:59
1
1
@jpa suppose the two systems have "ground" potentials that are 50V different, for example. Connecting them both to D- could be "interesting". Even if the potentials are only 50mV different, you may have created a noise-generating "ground loop".
â alephzero
Sep 16 at 13:07
@jpa suppose the two systems have "ground" potentials that are 50V different, for example. Connecting them both to D- could be "interesting". Even if the potentials are only 50mV different, you may have created a noise-generating "ground loop".
â alephzero
Sep 16 at 13:07
@alephzero Sure, but even a typical multiplexer or switch IC wouldn't handle that. The ground connecting first in USB connector, however, mostly eliminates that problem.
â jpa
Sep 16 at 14:14
@alephzero Sure, but even a typical multiplexer or switch IC wouldn't handle that. The ground connecting first in USB connector, however, mostly eliminates that problem.
â jpa
Sep 16 at 14:14
add a comment |Â
up vote
0
down vote
Perhaps it would be easier to leave the USB connector at one side of the enclosure and duplicate and / or relocate all other user-facing elements symmetrically. Then the enclosure can be rotated so that the USB port is facing the connector, while all other elements are still conveniently accessible.
Another option is to locate both ports on one side of the enclosure (at the opposite ends) and add a sliding stub inside the enclose which the user can move to open one port or the other. 12 MHz USB has a good chance of working with an extra disconnected port attached to it.
add a comment |Â
up vote
0
down vote
Perhaps it would be easier to leave the USB connector at one side of the enclosure and duplicate and / or relocate all other user-facing elements symmetrically. Then the enclosure can be rotated so that the USB port is facing the connector, while all other elements are still conveniently accessible.
Another option is to locate both ports on one side of the enclosure (at the opposite ends) and add a sliding stub inside the enclose which the user can move to open one port or the other. 12 MHz USB has a good chance of working with an extra disconnected port attached to it.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Perhaps it would be easier to leave the USB connector at one side of the enclosure and duplicate and / or relocate all other user-facing elements symmetrically. Then the enclosure can be rotated so that the USB port is facing the connector, while all other elements are still conveniently accessible.
Another option is to locate both ports on one side of the enclosure (at the opposite ends) and add a sliding stub inside the enclose which the user can move to open one port or the other. 12 MHz USB has a good chance of working with an extra disconnected port attached to it.
Perhaps it would be easier to leave the USB connector at one side of the enclosure and duplicate and / or relocate all other user-facing elements symmetrically. Then the enclosure can be rotated so that the USB port is facing the connector, while all other elements are still conveniently accessible.
Another option is to locate both ports on one side of the enclosure (at the opposite ends) and add a sliding stub inside the enclose which the user can move to open one port or the other. 12 MHz USB has a good chance of working with an extra disconnected port attached to it.
edited Sep 17 at 7:42
answered Sep 17 at 7:20
Dmitry Grigoryev
16.7k22770
16.7k22770
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f396328%2fusb-device-with-2-ports-how-to-protect-against-user-plugging-in-both%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
How do you propose wiring the two ports to connect D+ and D- together? You should add a diagram explaining the layout you propose.
â Solar Mike
Sep 16 at 7:23
@SolarMike Shared between the two - in the "correct" scenario, with only one cable connected, the other connector's D+/D- will be left dangling.
â monty
Sep 16 at 8:58
7
You should also consider designing the case with a moving cover so that only one usb port is exposed at once. That way you clearly communicate to the user that they are only allowed to plug in to one of the ports at once instead of confusing them when they plug in two hosts and one doesn't work.
â Nonny Moose
Sep 16 at 13:48
3
don't forget about the user who manages to find a male-male usb cable and plugs the device into itself !!!
â RozzA
Sep 16 at 21:59