ThinkClamp – short project update

Finally got some spare time yesterday to solder the new PCB revision and it works well, some better than anticipated. I’ve found one or two PCB errors. Nothing major though, it’s all working well enough.

I decided not to solder on the reset buttons as a slide between the ON and OFF positions of the slide switch would effectively reset the entire board.

Soldered board with MSP430F5502 and HM-10

Soldered board with MSP430F5502 and HM-10

Now it’s time for some programming. With a USB-enabled microcontroller, this board would eventually support both USB and Bluetooth functionality, preferably with the same firmware flashed. I’ve decided to use the HM-10 with my custom firmware instead of using a RN42-HID module so I can further improve the firmware.

Update: There might be a minor problem with the LiPo charger in which the battery voltage may jitter when a battery is not connected. This caused a bit of a random enumeration/disconnection problem. However, if a battery is connected to the battery output pins, the board seems to work fine. The USB microcontroller enumerates with no problems at all. For now, I’ve soldered on a single-cell battery pack so that I may get on to write the firmware.

ThinkClamp v0.6 Support: FAQ and Customizing Keyboard Matrix

This blog post answers a few frequently asked questions and describes the difference between the two firmwares provided as well as outlines the steps to obtain the matrix of a ThinkPad keyboard connected to the computer via a ThinkClamp PCB, for both version 0.6.2 and version 0.6.1 Rev 1.1.

Frequently Asked Questions

  1. Will the board design and source code be made open-source? No.
  2. What are the maximum dimensions of a populated board? 50x50x6.5mm.
  3. Will you be making a case? Yes, but in a very distant future.
  4. Will there be a Bluetooth version? Yes, the Bluetooth implementation is currently in progress.
  5. I am only interested in using the TrackPoint as a mouse, how do I use it with your board? If you are only interested in the TrackPoint, there’s no need to get my boards. Grab an Arduino Micro or Leonardo and load in Felix Klee’s TrackPoint example.
  6. Where can I get the components? Local electronic parts shop, element14, Digikey, RS, Mouser…
  7. How do I flash the firmware? The steps to flash the firmware is provided on the product page, but here are the steps anyway.
    • Download TI MSP430 USB Firmware Upgrade Example
    • Start the program, click Next, read and accept the terms
    • Unplug USB cable if it’s plugged in
    • Hold down BSL button while re-inserting the cable
    • Release the BSL button. The software should now detect the device
    • Choose ‘Select firmware’ and browse to the firmware downloaded. Difference outlined in Customizing firmware’s keyboard matrix section below.
    • Click ‘Upgrade firmware’ to flash the device
  8. A lot of keys are not showing up, what’s going on? Resolder the MSP430. Make sure all the pins are soldered.
  9. Some of the pin are not showing up and I’ve made sure all the pins are soldered? You may have a different keyboard matrix. Keep reading this blog post.

Customizing firmware’s keyboard matrix

In the firmware folder on Mediafire, you will find two text files: ThinkClamp_v0.6.txt and ThinkClamp_v0.6_datapipe.txt. These two firmware will send keyboard and mouse reports to the computer and allow the module to function as a normal keyboard. However, beside sending keyboard and mouse to the computer, ThinkClamp_v0.6_datapipe will also send a string consisting of the row and column of the pressed key to the computer via a generic 64-byte report (more information on report format can be found in Texas Instruments’ USB HID Datapipe documentation).

Using ThinkClamp_v0.6_datapipe, matrix of any ThinkPad keyboard can be found, providing the keyboard’s plug fit into the receptacle provided. The steps to get the matrix are as follow:

  1. Flash the firmware onto the chip via USB BSL or SBW
  2. Download TI’s Java_HID_Demo. If the link is broken, find the zip from MSP430 USB Developers Package page.
  3. Extract and run HidDemo.jar
  4. Click OK as we will be entering a different PIDoops
  5. Enter 0x0967 into the PID input box and click “Set VID PID”. The window will become:
  6. Click on the button above “Not Initialized”. The cross icon will become a green tick. The log window will print “Connected to device VID: 8263 PID 2407”.
  7. Now, as you type, printable and non-printable keys, the row and column pair will be printed (as row,col) in which both row and column starts at 0

You may want to wait a bit between each key presses as there seems to be a small delay between when a key is pressed and when its row and column is displayed. This latency only appears when in used matrix is being found.

To create a new firmware with this newly found matrix, the keys found need to be converted to its corresponding hex value in the USB HID Usage Table’s keyboard values on page 53. For example, this is my ThinkPad US T60 keyboard matrix:

NADA correspond to a 0x00. This means there is no key at this matrix position. After matching the keys to its corresponding key codes, it is then organized into a 8×16 matrix and written into the firmware text file after address F000 as follows. FN3QIJ5HW4OJQFA

ThinkPad USB Keyboard Project – It’s over

2014-06-07 06.33.07

This is the final PCB run of my ThinkPad USB Keyboard adapter project. It has a BSL button to upload firmware via USB using TI’s MSP430 Firmware update software, saving end-user lots of money from having to invest on a programmer.

Originally, I planned to write a custom USB flashing software on the PC that allows users to create their own matrices and keyboard combinations. However, due to lack of time, it is dropped.

Firmware wise, the keyboard scanning is pretty fast. All the keycodes are supported. Num Lock works, remote wake-up supported. It works just like a normal keyboard, except this one you can customize the matrix and add key combinations, at least I can.

Of course, the aesthetic of the PCB can be improved. Via holes can be smaller and not covering text, something like this:

Altium_Final_v0.6.2

But for functionality, all is well. Anyway, that’s it. No more ThinkPad keyboard adapters for me.  Here’s quick video of the board in action:

I have made the left-over boards avaiable for purchase from Tindie. Two flavours are available. Have your pick:

https://www.tindie.com/products/rampadc/thinkpad-usb-keyboard-adapter-v062-pcbreceptacle/

https://www.tindie.com/products/rampadc/thinkpad-usb-keyboard-adapter-v061-rev-11-pcbreceptacle/

Soldered up and… a pin isn’t soldered

So last week I got my v0.6.1 PCBs from DirtyPCBs and I decided to solder one of the boards and see how it improves upon version 0.6.0. This is my second time working with 0603 and QFNs. The first time didn’t work so well that this time I had to get a stencil and solder  paste. It turned out to be a pretty good experience. A quick swipe of paste onto the board, placed a few components, just hot air the boards and it was done in less than an hour! Shiny and everything.

Got it hooked to the computer, BSLed fine, loaded the firmware, keyboard detected, every keys works, except for F1, 2, W, CapsLock, S and X :(. Well that sucked. Turns out a pin wasn’t soldered under the QFN chip, This has become a bit annoying. Maybe the change to QFN to save $2.50 on cost isn’t exactly worth it.

2014-05-24 22.24.47

PCBs from DirtyPCB.com

Back in April, or March, Dangerous Prototypes (DP) opened a PCB service, that is just like Elecrow – free colour, except DP has nothing to do with the manufacturing, they just send your Gerber to some Chinese board house, where your boards would get manufactured, if your design meets their capabilities.

For one of my ThinkPad keyboard PCB revisions, I decided to try these guys out. At 14USD, they offer free colour and free shipping. However, I’m sure shipping is already included in that 14 bucks. Elecrow shipping was $6.5 on top of their $9.90 per 10 boards price, works out to be around $16. So DirtyPCB wins, in terms of pricing.

Both services take about a month and a few more days to account for non-business weekend days. So in term of shipping, they’re both the same. Thus, DirtyPCB still wins because it’s cheaper.

Now, this revision of mine is consisted of 8mil (thou) traces, 0.3mm via drills, 0.5mm fine pitch SMD components, 0603 passive components and a QFN with tiny plated through holes on its pad for better solder transfer.

Let’s have a look at one of the PCBs that arrived today (Look at that superb layout!):

IMG_20140519_134703

Except for that serial number at top left, everything else looks great! Connections wise, no shorts that I can find so far. All that’s left is to start soldering with a lovely stencil I got from OSHStencils, load the firmware and see how it goes!

ThinkPad Keyboards as USB Keyboards

Anyone who has used a ThinkPad would say they love the keyboard, because well, it’s the closest thing there is in the laptop market to a full-fledge desktop keyboard. Tactile response, curved keys that fits right into your typing fingers, business as well as consumers love using them.

I have always loved using my family’s ThinkPad T60. I love the classic keyboard layout. In 2012, Lenovo decided to jump to the chiclet island style keyboards. It was a bold move, but the performance is great. I have a T430 myself. Good laptop, a big chunky, a bit expensive but I bought it out of loyalty for the keyboard.

Buying the T430 was a turning point in my fondness towards Lenovo though. I only buy ThinkPad’s because I love their keyboards. So, armed with the skills to build electronics circuits and microcontroller programming, I decided build an adapter, a USB adapter for my T60 keyboard. Remember that I am very fond of the T60’s classic layout.

I started the project around early 2013. With my existing knowledge of MSP430 platform, I decided to use it for USB applications. So far so good, let me show you a video of what I did in late 2013.

Back then, I was using an Olimex MSP430-T5510, some n-MOSFET voltage converters and a lot of wires to connect the development board to a adapter I made for the T60 receptacle. A lot of problems were introduced: wiring problems. Thus, I decided to make PCBs. Now, I’ve made several revisions of the adapter.

T60 PCB revisions

Currently, ThinkClamp v0.5 (reason behind the name later) supports remote wakeup, TrackPoint, Numlock detection and switching with the FN key and best of all, full scanning support of the T60 keyboard matrix. Still a lot of work to do: performance improvements as well as adding features and maybe providing supports to other ThinkPad keyboards that share the same receptacle.