Before I get started, let me first say that I'm a software guy and anything I write about electronics and hardware should be taken with a grain of salt. The only formal education I have that's related to electronics is a couple of introduction courses to analog and digital electronics back at university (which was some time ago).
With that out of the way, let me share a bit about one of my latest projects: Building a USB KVM from the ground up.
The inspiration for this project came from one of my colleagues at Badoo, who was looking for a KVM that could handle 4K displayport switching (more on this later). Since I was just starting out learning (or rather re-learning) electronics I thought that this would be a fun challenge.
Normally a KVM would handle switching three different signals, Keyboard, Video and Mouse (hence the name) but due to my lack of experience I decided to keep things as simple as possible and stick to only handling the USB signal required to hook up a keyboard.
Why keyboard and not mouse you might ask? Well, the reason is quite simple: Almost all keyboards use USB 1.1 while mouses use USB 2.0. The significance of this is that the requirements for designing a PCB are much more relaxed for USB 1.1 compared to USB 2.0. For example, when designing a circuit for USB 1.1 you can breadboard it first to try it out. This is as far as I know not possible with USB 2.0.
With that out of the way, let me share a bit about one of my latest projects: Building a USB KVM from the ground up.
The inspiration for this project came from one of my colleagues at Badoo, who was looking for a KVM that could handle 4K displayport switching (more on this later). Since I was just starting out learning (or rather re-learning) electronics I thought that this would be a fun challenge.
Normally a KVM would handle switching three different signals, Keyboard, Video and Mouse (hence the name) but due to my lack of experience I decided to keep things as simple as possible and stick to only handling the USB signal required to hook up a keyboard.
Why keyboard and not mouse you might ask? Well, the reason is quite simple: Almost all keyboards use USB 1.1 while mouses use USB 2.0. The significance of this is that the requirements for designing a PCB are much more relaxed for USB 1.1 compared to USB 2.0. For example, when designing a circuit for USB 1.1 you can breadboard it first to try it out. This is as far as I know not possible with USB 2.0.
Requirements
Some of the requirements came from my colleague (who was the intended end user) and some from me.
- Support 1 USB 1.1 keyboard connected to two computers
- Using a push button to switch between sources
- Should be possible to boot both connected computers without getting "Keyboard not detected errors"
Out of these three, the last requirements turned out to be the most complicated one. What it means is that the computer not currently connected to the real hardware keyboard needs to be connected to a dummy (faked) keyboard. As we will see later (in a later post), this was also a good show case for what happens when you determine your requirements without doing proper research first.
The dummy keyboard
For the dummy keyboard my main goal was to create something that would be detected as a USB HID keyboard, as cheaply as possible. My first thought was to find an IC that implemented the whole USB HID stack in hardware but it turns out that these kind of chips are both hard to find and/or fairly expensive. Instead I settled on a software implementation.
Picking a software USB stack
There are several software USB stacks (LUFA, emUSB, V-USB, AVR USB, etc.) but most of them have some special requirements on what hardware they will run on (e.g some of them only run on a microcontroller that has built in USB hardware to handle low level USB functionality).
After reading up on the different options I decided to use V-USB from Objective Development. There were two main reasons behind this choice. Firstly, it does not require any specific USB hardware support and secondly, it runs on Atmel's AVR microcontrollers which I was already familiar with from working with the Arduino UNO platform.
USB Schematic
Another great thing about V-USB is that there are some really excellent tutorials out there for building USB HID devices. The device I ended up building was very much based on the design from the following blog post by Joonas Pihlajamaa. It uses an ATTINY85 microcontroller connected to the USB data lines (D+ and D-) using Zener diodes (Z1 and Z2) to keep the voltage levels down to 3.3V.
![]() |
Figure 1: The dummy USB keyboard circuit. |
The design also includes a jumper (JP4) that can be used to test the keyboard. If the jumper is closed it will result in a key-pressed event being generated once every second. This is also indicated by the LED (LED1) being lit up.
To be continued
In the next part we will look at how to configure V-USB to provide a USB HID Keyboard device that can be detected during boot (by implementing the HID boot protocol).
How do I make money from slots and casinos and make money
ReplyDeleteThe casino industry is full of gamblers, but many of the casinos offer games หาเงินออนไลน์ to attract even more players. What deccasino is the best way worrione to make money?