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?