PS/2 to USB active converter project (11/23/14) Video Added

Hi BLF,

A few days ago I got my hands on a Dell AT101W keyboard. When I took it apart, the datecode read 96, so it’s slightly younger than I am. I cleaned it up (it was just dusty, that’s all) but the only problem was that I didn’t have any PS/2 inputs because my only computer was a laptop.

I couldn’t just buy a generic PS/2 to USB adapter because they are passive. They are meant for keyboards that naively support both protocols and the adapter merely made the PS/2 jack into a male USB. Older keyboards like this one only support only PS/2 so the passive adapters don’t work.

Passive adapter:

The way to approach this issue is to use an active PS/2 to USB converter. I did order one from FastTech, but I’ve heard that it has problems when recovering from sleep.

This is the one I got: https://www.fasttech.com/products/0/10003144/1234500

It will take a few weeks to get here, but I wanted to work on something that actively converts PS/2 to USB… and more. Why go through all the hassle with a 20 year old keyboard?

It’s a mechanical keyboard, unlike anything I’ve ever used. I have gone through around 4-5 keyboards, and they were all membrane based, including my Logitech K270 that I’m typing on. It’s starting to lose its wireless range even after a battery change, which is pretty frustrating.

Here is the AT101W, and the W means that it has a Windows key, unlike the Dell AT101.

It has Alps Black switches for each of its 104 keys and is tactile but not clicky, meaning that you can feel when the key actuates but not not hear it distinctly like Cherry MX Blue with its distinct click. However, the AT101W is quite audible when the key bottoms out and comes back up. I’ll have to use it when my roommate’s not in the room, as it can get quite distracting especially when typing up essays or long posts like this.

I don’t play games however, although many gamers do prefer mechanical keyboards (especially the Cherry MX linear switches) because they have more feedback and many also support multiple keys being registered at the same time (N-key rollover).

One advantage of building my own PS/2 to USB converter is that I can program the controller to support extra function keys and key mapping. I use the multimedia keys on my Logitech keyboard (play/pause, mute, volume up, down, sleep, calculator) a lot and it would indeed be quite inconvenient without them. So I’m planning on mapping my own keys such as menu button + F1 = sleep, + F2 = mute, and so on.

geniekid at GeekHack (keyboard forum) did pretty much what I’m planning to do: Shortcake - a Dell AT101W mod

He put a Teensy board into the front bezel of the keyboard:

While I don’t plan to paint the metal frame, I’ll add the micro-controller into the keyboard and replace the PS/2 cable with a USB. Just like my other build threads, I’ll chronicle my progress here.

Table of contents
table(table#posts).
|Introduction|#0|
|MCU Bootloader|#1|
|Fuses|#17|
|It works!|#21|
|Video|#22|

The code for the converter is here: GitHub - tmk/tmk_keyboard: Keyboard firmwares for Atmel AVR and Cortex-M

Specifically, I don’t have a Teensy so I’m using an Atmel ATMega328P instead using V-USB.

This allows the MCU to be recognized as a USB device — a keyboard in this case.

Here is the specific instruction on building the firmware: https://github.com/tmk/tmk_keyboard/blob/master/doc/build.md

I’m stuck at the part where it says to start the chip in DFU (bootloader) mode. I’ve done some Googling, but couldn’t see where or how to start the ATMega328P in bootloader mode. If anyone knows about this, any help would be much appreciated.

I have an AVR ISP II to program with as well as Atmel Studio 6.2, Cygwin, MHV AVR Tools, and FLIP at my disposal. I can read and write to the MCU using Atmel Studio, just haven’t been able to power it as DFU mode. Thanks!

Nice score! I had one of those a few years ago and loved it, but I managed to misplace it when I moved back to Canada. Those keys are the ones that use buckling springs, right? I remember they were a joy to type on, even when compared to CherryMX blues or browns.

Thanks mate! I think the most famous keyboard with buckling springs is the IBM Model M but mine has Alps Black switches. I had the chance to type on buckling springs and it was a whole new experience. :slight_smile:

Sorry about your keyboard though.

Most of my keyboards are Model M’s, I’ve got a new Unicomp buckling spring at work I don’t think the people in near by cubes really like it. Good luck with the adapter board.

Nice!

You can get a Teensy at OSHPark for $17 (free shipping and US made :slight_smile: )

Awesome retro build man…good job

Wish I knew how to program arduino or C

Lucky you! Mechanical keyboards do annoy people around you though, haha.

Thanks for the link. I was very close to ordering the board until I realized that the ARM processor wouldn’t be compatible with AVR code. :~

Sure it can

http://www.pjrc.com/teensy/teensyduino.html

Neat! I wasn’t familiar with Alps switches, so I started reading about them. It looks like it would make for an interesting typing experience :smiley:

One big benefit of converting to USB is that if you accidentally unplug your keyboard while your PC is on (I’m a klutz and do this all the time), you wouldn’t have to restart your PC to get the keyboard to work again.

Hmm correct me if I’m wrong, but I think it requires AVR code, which is different from Arduino code?

Unsure…what the site says

so you need it to use AVR code…gotcha

Interesting project.

Have you set the boot loader fuses correctly?

Thanks for the tip. I’m pretty new to AVR programming so I’ll have to read some guides to configure the fuses properly for bootloader access.

http://www.clickykeyboards.com/index.cfm/fa/categories.main/parentcat/11298

Interesting project! I have one of the PS/2 to USB adapters that ClickyKeyboards sell. I did request them recently at BG, FT etc. It’s fine for Windows though I use software to make shortcuts.

The AVR chips need the bootloader code programmed into them at the highest locations of flash memory. There are fuse settings that cause the processor to jump to the bootloader address when it is reset and also to set the size of the bootloader section of memory. Most Arduinos come with a bootloader already programmed into them.

You could skip using a bootloader all together and just program the chip using your ISP programmer. Bootloaders just allow you to update the code via the serial or USB port… handy for end-users that don’t have an ISP programmer.

Oh awesome, this turned out even easier than I had expected.

Thanks for the tip!

Great, I’m almost done with building the circuit board and soldering the components together.

I’ve also worked the fuses out with the exception of the clock source selector: SUT_CKSEL.

I have been adapting the fuse settings of ATMega168P, which is documented here:

I’m planning to use a 16MHz external capacitor but I’m not sure what SUT_CKSEL value of the low fuse I should use for a ATMega328P.

Any help would be much appreciated. Thanks!

Here’s the schematic of the circuit:

Edit: I found the same clock setting as the 168P, so that’s solved.

Edit: Okay, I accidentally set the clock setting to “external” without too much thinking and now I’m locked out of the chip. Maybe a high voltage programmer to reset the chip will be my next project.

Thats awesome!

No, you don’t want to do that… way too much work. Best to just buy another $5 chip. Or you could drive the clock line with an external canned oscillator.