USB Switch

General discussion on mikroPascal PRO for PIC.
Post Reply
Author
Message
joseLB
Posts: 442
Joined: 02 Apr 2006 05:56
Location: Riode Janeiro, Brasil

USB Switch

#1 Post by joseLB » 24 Dec 2009 23:41

Hi
After some wekends trying, I could make a very simple USB 2.0 switch, and would like to share with you.

With it you can switch a USB device betwen 2 PC's. I just tried with penDrives of 1,2,4,16Gb, Vista, XP, USB1.0, USB 2.0
Image
I see no reason to not work with any other device, but i didn't tried.

The main dificulty I had was to deal with USB2's 480Mbits/sec., and it's low voltage diferential D+/D-. Track lengths, unbalanced lengths, impedance mismatch where the main problems.
Here is the schematic
Image
Here are the layout (silk and PCB). See that D-/D+ usb cable wires (white/green) are soldered under the relay and before it is soldered.
Also, the distance betwen them is the same of the USB-A pinout connector, in order to reduze any impedance mismatch.
R1,W1,G1,B1 and 2 are the red,white, green, black wires in the USB cable I soldered straigth in the board.
For the penDrive (USB device) I soldered a plain USB-A "female" connector (the ones found in PC's main board).
For D1 and D2, the best would be schoty diodes, but as I haven't them, I used 1n4148. Seems that even you use an external power supply, it's needed to "connect" the power suplies of both PCs as shown. But, you can try without them.
Image
I hope it's of usage to someone. If you wish the 600 dpi board layout, let me know.
Here are the USB pinouts/cables: http://pinouts.ws/usb-pinout.html
Regards
Jose
*ps: if you want to see the history on how this hapens, take a look at: http://www.mikroe.com/forum/viewtopic.php?t=22529

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

#2 Post by Dany » 25 Dec 2009 14:06

Nice! Thanks. :D
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

joseLB
Posts: 442
Joined: 02 Apr 2006 05:56
Location: Riode Janeiro, Brasil

#3 Post by joseLB » 29 Dec 2009 19:27

One more reminder:
One of the biggest problems I found during tests, was when I "cutted" an USB extension cable and used the "female" part of the cable soldered at the board for the penDrive. The best solution is to solder a "female" straight on the board, like in PC's main boards.
I'm just repeating it as probably this is the worst thing you can do in terms of noise/reflection, or at least where most of my problems comes up.

On other hand, the size of the 2 "male" wires (the ones that goes to the PC) seems to be not important (I have one very short 30 cms - and another about 2 meters).

Post Reply

Return to “mikroPascal PRO for PIC General”