Building a mechanical keyboard – XD60

[meta-thought] Typing this on the keyboard that this post is about. Feels amazing. This post is probably going to be lengthy and more stream-of-consciousness compared to my usual writing style because this keyboard is really so good to type on it’s so good to type on it’s so good…

Currently on exchange in China, don’t know if I was being too sedentary or whatever, but I was having neck and back strains while sitting at my desk, and I realised I was sitting too near my laptop. So, the natural no-brainer solution would be to sit FURTHER away from my laptop, no? Oh hey, that won’t work! Guess what, laptops (at least the ones in the form factor I own) have keyboards that are literally stuck to their screens!

A perfect excuse to get something I’ve been eyeing for a long time: a mechanical keyboard. Tick tick tack.

So, taking advantage of my (passable) coherence in the Chinese language and the proximity to a delivery center, I decided to TaoBao everything. Apparently 60%s were what I was looking for – a minimalist approach to typing, plus the portability and sleekness – what’s there not to want?

Of course, I had to do my research and I headed over to r/mechanicalkeyboards to learn more and get a feel of the DIY scene. I learnt about the different switch colors, their uses and how they work, and the main differences between different brands. I always wondered how keyboard controllers could remain small with the massive number of inputs it gets – usually at least 40, and between 60-100 is common – the controllers would have to have a massive number of digital pins capable of reading the inputs all at once, no? Wrong, Here’s a fantastic article by Michał Trybus detailing how a keyboard matrix works: [http://blog.komar.be/how-to-make-a-keyboard-the-matrix/]

So after some deliberation between the Satan GH60, the ORG60 and the XD60, I decided to get the last one as it was the most reasonably priced (289 Yuan, or roughly SGD$60) for the PCB, stabilizers (stabs!), gateron blue switches, and white ABS keycaps that are really, really white.

[Tutorial Section – Works for the XD60, process generally applicable to similar boards] So building the keyboard actually begins with you placing the switches in the desired through-hole, um, holes in the PCB. This way, you’ll know the layout you want. I’d recommend you put the keycaps on too and test them like they’re a finished board (it’s fun). It was at this moment, I realized my left-shift keycap wasn’t a 2u size like I planned it to be, which means I probably have to buy a new set of keycaps to avoid being laughed at. [more on this later]

[Quick note: I hit a semi-roadblock for a few days because the USB-mini cable I ordered had only 4 pins compared to the 5 needed. Probably shouldn’t stinge on an extra S$2 and end up wasting time and money. No matter, TaoBao-ed a solid one from the same supplier.]

The next step is to solder the switches onto the PCB, a light amount of solder will do, since the pins are really thin in comparison to the PCB holes. It also helps if you have to remove switches for troubleshooting or a change of layout, which I needed to do, due to the perennial problem of I’m careless as heck when it comes to software. It’s an amazing moment when you first connect your PCB+switches skeleton to your computer with your USB cable and hear the cute ‘device detected’ jingle on Windows. Truly music to the ears.

Now, to program this particular board (XD60), you need to do a few things. You need to have:

1. Designed your keyboard layout on KLE that is CONSISTENT with the switches you have soldered. [http://www.keyboard-layout-editor.com/]

2. Downloaded Zadig.exe (google it), and the

3. TKG Chrome App from the Chrome Apps store (This allows the Keymapper to burn, I think)

Explanation: KLE gives you a simple, GUI way to arrange and check your key widths. One thing to note (this was the perennial problem that I encountered), in the raw data section, the string listed for the SPACEBAR key is shown as an empty “”. This should be replaced by “SPACEBAR”. I literally spent an hour racking my brain over whether it was a solder fault, board printing fault, or fault in our stars. But, your configuration can then be harvested by copying the code in the raw data section.

Now, your computer doesn’t know that the PCB you’ve just connected is a keyboard; and it can’t talk to the controller on board yet. Zadig.exe installs the drivers needed to recognize the board as a USB device. When that’s done, you can then start to transfer the layout data to the newly-recognized keyboard.

Copy the data from the raw data section in KLE, then fire up the TMK Keymap Generator [http://yang.tkg.io/].Select GH60(RevXD_Mod), Simple layer (for now) and paste the raw data into the text box. Pressing the tiny reset button on the back of the keyboard will put the chip on the PCB into bootloader mode, and the ‘Burn .eep’ button at the bottom of the website will turn green.

You know what to do, press the Button of Eminent Technology and the layout will magically burn to the controller on your PCB. When done, you will find that your keyboard… works. So yeah, as always, go out and make your own stuff, it’s fulfilling, gives you a great broad skillset, plus you get what you originally wanted to buy at a fraction of the cost, utility maximized.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s