0
\$\begingroup\$

I am building a 4x4 Arduino controlled USB switch The idea is as follows:

  • 2 sets of CMOS analog switches form a 4x4 matrix to switch the D+ and D- USB signals using MAX4652SE chips
  • The USB devices are not powered by the hosts but by the switcher and power is controlled to each device with TPS2066D Power switches
  • All of these are controller by 74HC595 Shift registers set by the Arduino

The devices can draw quite a lot of current, e.g. 500ma. So I am powering the device with a 2A 5V supply. The 5V supply just goes directly into the circuit. No other power regulation happens

The Arduino part (display, keyboard etc) is working fine but I am having 2 issues with the switching part:

  1. When attempting to power up devices, the first 500ma device powers up ok, but the second one fails to, when I reverse the order of devices, it behaves the same, so it's not the devices.
  2. When testing simple USB switching (a mouse connected to a PC) only about half of the connections worked (i.e. the mouse worked on the PC), the other half I got a 'device not recognized on the PC.

some thoughts: Issue 1:

  • Do I need to somehow treat the power going to the power switches differently to the power to the rest of the circuit? it's just 5V coming in and sent to everything equally now
  • The TPS2066D is rated at 1A, are they appropriate for powering USB devices?
  • Could something be limiting the amount of current going to my devices?

Issue 2:

  • Are these CMOS switches not appropriate for USB? (They have an on-resistance of 4Ohms, which seemed pretty low)
  • if they are ok, do I need some kind of buffering from the USB in -> out data lines? (I noticed the off resistance between points varied from >50Mohm, down to around 200kohm, which I couldn't understand why)
  • I used the auto router function in eagle to make the board, and there are hundreds of vias and it seems very complex, could this cause interference on the USB data signals?

Thanks, any help is appreciated as I am not sure how to progress from here...

Switching Schematic Switching Board

Datasheets: https://www.ti.com/lit/ds/symlink/tps2066.pdf https://datasheets.maximintegrated.com/en/ds/MAX4651-MAX4653.pdf

UPDATE:

Bit of project background and why I needed this device: This for switching USB devices between several musical instrument from a company called Monome (https://monome.org/) I have 3 USB host: The Teletype, Ansible and Norns (2 usb ports) and 3 USB devices: A bluetooth key, Arc and Grids.

All of the devices can be used on any of the hosts. So I wanted to:

  • Allow for fast swapping
  • Reduce physical ware by not actually having to disconnect

This is the closest schematic I could find to what I wanted which is simple a 2->1 but uses a switch. So I thought I could replace the switch, with cmos ones.

I suppose I'm trying to make something like this (USB2) with a better UI: https://www.startech.com/en-au/cards-adapters/hbs304a24a

2 -> 1 switch schematic

\$\endgroup\$
5
  • \$\begingroup\$ "They have an on-resistance of 4Ohms, which seemed pretty low" You already know the current can be up to 500mA (inrush current can be briefly higher). How much voltage do you lose putting 500mA through 4 ohms? However the product page says 70 milliohm which is much more acceptable. \$\endgroup\$
    – Ben Voigt
    Aug 5, 2021 at 23:08
  • \$\begingroup\$ Ahh, the 4 ohms is for the switches on the DATA lines. Wasn't clear. \$\endgroup\$
    – Ben Voigt
    Aug 5, 2021 at 23:11
  • 2
    \$\begingroup\$ I would worry about the data switches given that the frequency response plot in the datasheet stops at about 200 MHz. Are you using this with low-speed and full-speed (12 Mbps, introduced by USB 1.x) or high-speed (480 Mbps, USB 2.0) devices? \$\endgroup\$
    – Ben Voigt
    Aug 5, 2021 at 23:17
  • \$\begingroup\$ I'm am 99% sure they are all USB 1 \$\endgroup\$
    – Guy Taylor
    Aug 6, 2021 at 1:15
  • 1
    \$\begingroup\$ This particular switch can be used for only up to 10-20MHz. It has substantial capacitance to ground (16-32pF), which will likely kill USB HS communication. \$\endgroup\$ Aug 12, 2021 at 4:34

2 Answers 2

3
\$\begingroup\$

It is a miracle it works even sometimes. Basically, if you want to route a high speed signal, you need to route it in a proper way that is suitable for high speed signals.

USB data pins are a high speed differential pair with a differential impedance requirement of 90 ohms.

This design does not keep the differential pair as a differential pair, it splits the pair into separate ways to be routed by separate chips. It also means that wires of each pair can have a considerable length difference, which is also not good. The wires should be kept as a pair wherever the are routed. Vias must be avoided, and if there are vias, there should be not too many of them, and both data wires of a pair should have equal amount of vias, at equal lengths along the wire.

This design also does not keep the differential impedance requirement of 90 ohms, and does not control the single-ended impedance either. There's just wires going everywhere without a ground plane. There should be a ground plane and the USB data tracks should be designed to have the correct impedance.

High speed design of USB also does not allow for stubs. The data pair should go from one place to another place without splitting it into two or more places, as the electrical pulses reflect back from the unterminated ends. This design takes in USB and splits the pairs into separate wires, and then each wire is split into four chips.

The chips also seem to be generic analog multiplexers. Special chips for multiplexing high speed USB links exist for this purpose.

I recommend reading guides how to do high speed design and USB design guidelines.

\$\endgroup\$
3
  • \$\begingroup\$ Thanks for the detailed answer. Sigh. This was my first crack at something like this! Obviously much to learn! I think I get most of your feedback but I can ask a couple of questions: How do I "keep differential impedance requirement of 90 ohms"? Would perhaps 4 of these be more appropriate? au.mouser.com/datasheet/2/256/MAX4899AE-MAX4899E-1515854.pdf all 4 input would go to their own chips, could I then tie all the outputs together? or would that also cause an issue like you when in: "High speed design of USB also does not allow for stubs" \$\endgroup\$
    – Guy Taylor
    Aug 5, 2021 at 23:37
  • \$\begingroup\$ @GuyTaylor You would keep pair impedance by choosing correct trace geometry (width, distance from each other, distance from ground plane). Yes that would have a stub problem too. Since only one host port can only be connected to one device port at a time, perhaps if you explained what is the purpose of that matrix, what would it do, to help understand how to solve the problem why you decided to design this in the first place? \$\endgroup\$
    – Justme
    Aug 6, 2021 at 0:22
  • \$\begingroup\$ I just update the main description with what I need this device for. thanks \$\endgroup\$
    – Guy Taylor
    Aug 6, 2021 at 0:57
0
\$\begingroup\$

There is an engineering solution to the problem of switching a USB peripheral between several (two at least) USB hosts. It is called "switching hub". Combination of these devices can provide a switch between tree and more host computers, all without re-plugging cables. enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ HI @Ale..chenski, yes, I can't use a normal hub, as the host device don't support it. Switching hubs are what I need, but all those products have a rather poor UI which is why I want to make my own. This is post (having a lot of new clues and pointers) I've been researching USB design. My new plan is to use something like these chips: ti.com/lit/ds/symlink/ts3usb30.pdf and do a 4 to 16 fan out followed by a 16 to 4 fan in. with my controller selected the 'select input' and 'bus switch enable' inputs. I am getting my head around the 90 impedance requirements of the PCB too \$\endgroup\$
    – Guy Taylor
    Aug 13, 2021 at 5:17

Your Answer

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

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