Introduction: A Better ThinkPad USB Keyboard Adapter

When I first got started with microcontrollers, the one thing that I wanted to make the most was a USB adapter for my ThinkPad T60 keyboard. I've always enjoyed typing on my T60 keyboard and I would love to use it on all the laptops I may buy in the future.

Since then, I started to develop two solutions: an Arduino implementation and a MSP430 implementation. It was easy and straightforward to create an adapter using an Arduino but due to the limited pins count, I had to resort to external counters and ICs making keyboard scanning was unbearably slow. The footprint was too big, there were wires everywhere. In short, I didn't like it.

So I pushed on with my MSP430 implementation and finally, the project came to fruition. Despite being significantly harder to develop, this approach offers much greater benefits: faster keyboard scanning time, NumLock keypad toggling, remote wake-up and full keycodes support. And of course, the TrackPoint works too.

Please note that this is written more as a project log, rather than a tutorial. Links to PCBs and receptacle, and firmware code will be provided at the end.

Step 1: The Hardware

I got into the microcontroller world with Texas Instruments MSP430 Launchpad so I chose to use their USB chips. This turned out to be a fairly poor investment. Firstly, since the keyboard will be plugged in to the computer all the time, there is no need for the MSP430's super low power feature. Secondly, the TrackPoint is essentially a PS/2 mouse. It uses 5V for power source. Using a MSP430 at 3.3V requires logic level converters. Thirdly, USB chips are expensive. During the development, I learnt of AVR's V-USB, which can turn most Atmel 8-bit microcontrollers into USB microcontrollers. It uses 5V power lines, the same as the TrackPoint and the chips would be cheaper. But it was late as I've already invested a lot of time into learning the MSP430 family and getting AVR development boards and programmers were out of my budget at the time.

In general, the keyboard requires a minimum of 28 input/output lines for 16 rows, 8 columns, 1 FN line and 3 PS/2 lines. Although 3 PS/2 lines are required, one of the line is for the controller to reset the TrackPoint, thus only 2 logic level converters are needed.

The final hardware design is the bare minimum to use USB functionality on MSP430 line. The button is used to flash firmware over USB using MSP430's Bootstrap Loader mode. This eliminates using an external programmer, great for the end-user.

From schematics of the ThinkPad T60 computer, it is found that the keyboard receptacle used is manufactured by JAE with part number of AA01B-S040VA1.

The goal is to save as much money during the prototyping stage as possible. Since 50x50mm is the smallest and cheapest option available from most cheap PCB manufacturers, the PCB design is made to fit into these boundaries.

Step 2: The Software

In code, the keyboard matrix is consisted of keycodes from the USB HID Usage Table, from page 53. It is written as a single dimension array, organized in a similar fashion to the table as shown: 8 rows by 16 columns. In the firmware provided (next step), this matrix will be listed from address 0xF000. The numbers are hex codes of the corresponding key from the matrix. You can edit the hex codes in this firmware file to change the matrix accordingly to your keyboard matrix if needed.

Originally, I planned to write a PC software that allows user to customize the matrix, add custom keyboard combinations, etc. However, given that not a lot of people would know if their keyboard receptacle for their laptop is the same as mine, it wouldn't be useful, and by adding custom keyboard combinations, it may slow down keyboard scanning. The final result may not be worth it.

Step 3: Downloads

This project is closed-source. Although the source code is written in C, it is split into many source files and quite hard to navigate through. Without proper documentation, it is more beneficial in my opinion to learn from application notes provided by microcontroller vendors.

You can get the PCBs from Tindie. They are available in 2 flavours. Have your pick:

ThinkClamp v0.6.1 Rev 1.1

ThinkClamp v0.6.2

The version number difference is based on the components types used. They both work well, v0.6.1 has may have better stability electrical wise, but it uses smaller components so they maybe harder to solder, while v0.6.2 sticks to the bare minimum and can be easier to solder.

Firmware: http://www.mediafire.com/view/15cu8yu3ymbgnbh/Thin...

To upload the firmware:



• Start TI MSP430 USB Firmware Upgrade Example software, click Next and accept the terms
• Unplug USB cable from device if plugged in
• Hold down BSL button, then insert the cable
• Release BSL button The software should now detect the device.
• Choose 'Select firmware' and browse to ThinkClamp_v0.6.txt
• Click 'Upgrade firmware' to flash the device


Comments

author
DarknessM made it! (author)2017-03-24

Hi RampADC, can you please send me exact part number for MSP430? I found

MSP430F2370TRHAT but I'm not sure it is compatible with your FW. Thank you.

author
Jeppe RishedeT made it! (author)2016-07-05

I've had a W500 die on me. I'd really love to keep using the keyboard, but it seems only rampadc ever made this work.
Links are dead and tindie shop closed :(
Anyone know how to build an adapter now?

author
rampadc made it! (author)rampadc2016-07-05

Hey Jeppe, it seems that the W500 keyboard uses the same keyboard receptacle as the T60 in this instructable. If you could get your hands on more receptacles, you could build your own boards. I don't have any receptacles left and it's very expensive to get more.

author
Jeppe RishedeT made it! (author)Jeppe RishedeT2016-07-06

Hi rampadc, Thanks so much for your reply. what I meant by dead links was actually just that there are no links to the schematics. I would be fine with having boards made (and stealing the receptacle off the original motherboard) but I only have a CS background, I can not design such a board my self.

It would be a HUGE help if you would share the scematics with me :)

author
mosmond made it! (author)2014-06-09

This project looks a little over my head. I could NEVER have done this from scratch as you did. However, my understanding is that you've provided links to the hardware and completed code, so that noobs like me can replicate your results. I'd really like to make one of these adapters, since I have an "aging" (i.e., obsolete) X200 Tablet with a keyboard that I'm really fond of. (I'd also like to connect the touch screen to a desktop PC, but I've yet to see an 'ible on that particular task!)

author
rampadc made it! (author)rampadc2014-06-14

Open up your tablet's motherboard and see if your keyboard receptacle is the same as mine, see step 1. If it is, get one of my adapters, otherwise, have fun hunting down the receptacle.

About This Instructable

7,944views

37favorites

License:

Bio: Make things for fun
More by rampadc:Soldering headers without drilling holesA Better ThinkPad USB Keyboard AdapterMake a ThinkPad keyboard USB adapter with Arduino
Add instructable to: