EEVblog® Electronics Community Forum

Electronics => Microcontrollers => Topic started by: AussieBruce on June 15, 2024, 03:16:31 am

Title: Extending USB connection on embedded device
Post by: AussieBruce on June 15, 2024, 03:16:31 am
I’m embedding a microboard in an enclosure, and need to extend the USB connection to a separate connector on the outside of the box. The connection points are easily accessible as lands under the board. I envisage short lengths of unshielded wire, with the D+ and D- signal leads twisted. Path length is expected to be below 4 cm. The USB will be running at 480 Mb/s.

I don't have room to use a plug-to-plug cable.

Can I be confident that this arrangement will work OK?
Title: Re: Extending USB connection on embedded device
Post by: Nominal Animal on June 15, 2024, 04:40:46 am
For USB 2.0 High Speed (480Mbit/s), yes, it should work fine.

Many PC motherboards used to have 2×5-pin headers (bog standard 0.1" spacing) for a pair of USB 2.0 connectors to be mounted on the front, with a twisted pair for D+/D-, each, and straight wires for the common USB 5V and GND, for a total of 6 conductors.  Mine were about 300mm/12" long, and I had no problems.

(I'm assuming the environment inside the enclosure is not so noisy, electromagnetically speaking, that the microcontroller needs a shielding can or anything like that.)
Title: Re: Extending USB connection on embedded device
Post by: peter-h on June 15, 2024, 06:57:38 am
You need to keep the length of the stripped conductors (those not inside the shield) very short - under 2cm IME and preferably under 1cm.

I have done this quite a lot e.g. wiring a toggle switch to switch the USB port of a Sony action cam to either a +5V power supply (the "smart" type which needs the D+ and D- connected because it presents specific resistors to them, for charging faster than 500mA) or to a USB data cable to a PC. I found all kinds of problems, and the PC cable became really critical as to what brand etc. One obvious solution was to connect the PC via an ancient USB1 hub; it just knocked the transfer speed down quite a bit.