Dual USB cable - Firware hot-swappable

nicstreet

05 Feb 2016, 21:59

Maybe not immediately obvious what I want to do here so... :?:

I often have to work with client laptops\desktops, I hate having to use anything other than my own external keyboard, I've used KVM's, KM's, which can cause all sorts of issues with some of the port monitoring software used by my clients. Likewise software like Mouse without Borders and Synergy are great but fall over when RAS connected or NIC disabling features kick in.

:idea: What I'd like to have is an extra USB cable from my keyboard to a second machine and then be able to switch between cables using perhaps a TMK key shortcut or I suppose worst case a key wired direct to perform this function. :idea:

Has anyone done this, does anyone have sufficient electronics knowledge to be able to advise?

Thanks in advance all... :)

User avatar
flabbergast

05 Feb 2016, 22:10

This will be tough. The point is that the hardware USB layer in the MCUs that are normally used for "custom" keyboards (ATMEL's AVRs, PICs, ARMs, ...) fully expect that there's only one "upstream" USB. Also the USB protocol itself does not allow for one client to sit on 2 different USB buses.

I think the best you can hope for is to have a hardware "switch" (basically on the cable) that will physically reroute the connection from one cable to the other, and then a "hotkey" that will reset the MCU so that a new USB connection is established.

nicstreet

06 Feb 2016, 10:35

Thanks mate, appreciate your comments. Given some of the MCU's cost pennies now, what about a dual MCU setup whereby the input to each is switched via a small input PCB? perhaps just switching v+?

Apologies if I'm talking out of my 4rs3, feel free to crack me with a piece of 4x4.

User avatar
flabbergast

06 Feb 2016, 11:31

That would work, good idea! Just wire the same matrix to two independent MCUs; one just needs to make sure that they don't attempt to scan the matrix at the same time. The USB part can be on simultaneously on both (so they both would appear as a keyboard to the respective computers - this also saves on having to enumerate the keyboard anew every time you make the switch). It's just a matter of letting the MCUs know when should which one be active on the matrix side.

That can be achieved for instance by having a mechanical switch on the PCB, and modifying the firmware so that it periodically checks the status of that switch.

TheJJ

07 Feb 2016, 15:34

Uhm, what about connecting 2 MCUs (via UART or I²C)?
You can just define a hotkey in the matrix (or separate hardwired switch) to send the data from "master" MCU to ether its own USB or to slave MCU.

User avatar
flabbergast

07 Feb 2016, 16:17

Sure, that would work as well. More code on the firmware side, less trouble on the hardware side.

Post Reply

Return to “Workshop”