[Novalug] USB connector to switch between 2 devices

Nino Pereira ninorpereira@gmail.com
Sat Mar 28 21:28:39 EDT 2020


My bad on the number of cables: it's 5 including the ground.
So, an A/B switch should work if indeed the switch inside
it has enough wires. I haven't opened up one of the ones
I have to verify that they are all connected (or measured
the connectivities), but I assume they are all there.
.
On 3/28/20, Peter Larsen via Novalug <novalug@firemountain.net> wrote:
> On 3/28/20 7:56 PM, Nino Pereira via Novalug wrote:
>> 1: use one of those old data switches that at one time in the distant
>> past allowed you to connect two different printers to one computer,
>> or vice versa. Rewire that for USB, either directly or with an
>> old-fashioned
>> printer plug (DB25 I believe) to USB.
>
> That wouldn't be that easy - at least I predict that when you turn the
> switch the master (the car) wouldn't see the device change.  Let me be
> more specific - if you pass through power and only switch over the data
> lines, it will definitely cause issues.  So switch over all wires (for
> USB A/B this is 4-5 wires depending on your shielding).
>
>>
>> 2: IIUC the USB has 4 wires, but only 3 are independent.
>
> USB 1.x standard plug (the big flat one we all use in computers): 4
> wires active (typically there will be 5 wires in the cable)
> USB 1.x mini: 5 wires
> USB 2.x micro: 5 wires
> USB 3.x standard: 5 wires
> USB 3.0 type A/B: 11 wires
> USB 3.0 MicroB: 10 wires
> USB 3.1 Type-C: 12 wires
>
> In particular with USB 3.1 things are not as simple as they used to be
> (since you can flip the plug).
>
> The basic USB that everyone knows typically has 5 wires:
>
> 1: VCC
> 2: D-
> 3: D+
> 4: ID (used with mini/micro)
> 5: GND
>
> Not sure what you mean by independent. Everything is in reference to
> GND, and you need to ensure proper pull-ups on D-/D+ for data transfer
> to work. Pin 4 can often be omitted - it's used to signal (using pull to
> GND) who is the master. Since a lot of devices can only work as slaves,
> leaving this floating means the computer "wins" and becomes the master
> by default.
>
> At times the shell - the metal around the plug is connected using a 6th
> wire that surrounds the other wires - or it's shorted with GND. Sorta
> like old BNC for antennas used to be.
>
> The data on the D lines is a simple bi-directional serial protocol where
> devices identity themselves to the master, and the master then uses the
> address to "talk to" the individual devices. You see this data with
> "lsusb". The key data is the ID values (vendor:device) in hex.
>
> Do note that once a device is connected, depending on the device type
> the communication protocol "changes" - this is (to me) really the power
> of USB. If it's a headset or USB storage device, it's the same cable and
> plug I use - but what's transferred is very very different.
>
> This means that technically you can have more than one device on a line.
> As long as the slaves don't try to talk at the same time that would
> work. If they don't, you need a little "traffic cop" - the HUB - in the
> middle.
>
> But just cutting things over if you for instance have a headset and a
> USB key inserted would most likely not end well unless you do a full
> reset (power/on off).
>
>> If so, use
>> one of those switches that has parallel 3 channels. I have one
>> that works with 12  wires I can give you.
>
> Every time a USB device is powered on, it sends out a "power on"
> signature to the master. This is how your computer can see a new USB
> device (and what device) was connected. You'll need to ensure the power
> follows along with the data, so the device powers on as if it was
> plugged in to identity itself.
>
> But really, the USB hub should look like any USB device to the master.
> It just allows you to send commands to multiple device addresses.
> They're pretty dumb devices.
>
> My guess would be that it wasn't a powered USB hub and in that case you
> can run into issues when you plug two devices in that both want more
> than few few hundred milliamps you can typically draw via USB.
>
> --
> Regards
>   Peter Larsen
>
> **********************************************************************
> The Novalug mailing list is hosted by firemountain.net.
>
> To unsubscribe or change delivery options:
> http://www.firemountain.net/mailman/listinfo/novalug
>



More information about the Novalug mailing list