Once the main PCB/keyboard assembly was done, I started working on the USB connection. Originally one of the goals was to keep the Deck looking stock, and along those lines my original thought was that I could build the USB controller to handle the LEDs, and then put a passive USB hub inside the Deck casing to connect both the custom controller and the regular Deck interface together. The hub connection would then exit the case and connect to the host. It would look stock because there would only be a single cable coming out of the case.
Sounded like a good plan to me, so the first step was to get a passive USB hub. For that I went down to the local store and found the cheapest, smallest USB hub I could find (smallest meaning the one with the smallest PCB). I managed to find a 4-port Vakoss USB 2.0 hub for $15. Taking the casing off revealed the PCB:
The PCB was small enough to work with, so I removed the USB connectors which weren't going to be needed. For this I was fortunate in that I had access to a hot-air solder rework station. Multi-pin connectors can be removed from PCBs using a soldering iron, solder wick, and a solder bulb, but it's just many times easier with a rework station. Five minutes on the station and the task was complete.
The next task, wire the keyboard and LED controller into the hub. For space reasons I couldn't use conventional plugin connectors, so I hard wired these together by soldering directly to the USB hub PCB. The connections can be seen below wired into ports 2 and 3 of the hub. I placed the hub in position directly above the "lock" lights, on the top side of the Deck board (held in place with double-sticky foam tape of course). The only conventional connector was the main cable going to the host PC, for that I left the mini-USB connector in place.
After getting all the wires connected I plugged it in for the moment of truth, and it WORKED!
Well ok, it sort of worked, as you can see not all the lights are lit, so it did need some minor wiring fixes. But the main thing was that plugged directly into the host the USB communication worked perfectly. My interface program could talk to the LED controller and the keyboard worked fine (including the built-in FN key). So figuring I had it done, I then plugged it into the KVM, where it didn't work at all.
Enter my KVM. This useful but highly aggravating piece of tech has been at the core of more than one hardware problem of mine. I plug my fully functioning keyboard directly into the host and it works great. I plug it into the KVM and I can't even type on it. I was stumped. I tried using USB diagnostic tools to try and figure out what was going on, and it didn't help much. I could see the interfaces when plugged into the host, and I couldn't see them when on the KVM. I banged my head on this for hours, until I finally realized what was going on.
The problem was that I plugged the keyboard into the keyboard port of the KVM. The keyboard port, not the USB hub, plus something else, plus keyboard port. The keyboard-ONLY port, see the problem? The KVM outright refused to communicate with my hybrid hub/keyboard/controller device. It only wanted to talk to a straight keyboard. ARGH! so close, so close... Unfortunately the KVM is an essential part of my setup otherwise I would have chucked it right there.
This turned out to be a fundamental flaw with this approach, there was NO way to make these devices work nicely together (I tried, trust me). So in the end I knew the hub idea had to go. That left only one option: two USB cables coming out the back of the keyboard, one for the keyboard, and one for the controller.
So the hub idea was out, therefore the next thing was to run two cables. I didn't want to run two completely independent cables because it would look weird, and they wouldn't stay together. So I decided to bind the cables together somehow. After thinking about it a bit I figured the best way was to use some sleeving and run the cables through it. This sleeving is a black flexible mesh, it's typically the stuff people use to bind their power supply cords and such together. I sleeved most of the cable except the last foot or so, which I left separate to allow connecting it to different places. For the final touch I added a bit of colored wire on the USB cable ends so I could tell which end was the keyboard and which was the LED controller.
Once put together I plugged the keyboard into the KVM and the LED controller directly into a host port. Powered it up and it worked great!
Last bit on the hardware side was to do an electrical check to make sure the LEDs all worked and then replace the covers (to make sure they still fit!)
It all looked great, so finally the hardware was complete. Next step, software.