Topic: internal thinkpad keyboard/trackpoint interface

As the other thread is more about general, I'd like to discuss here how to make as many thinkpad keyboard/trackpoint combination available.
I guess there is some interest in using those keyboards and even some to reuse an old thinkpad case in general to place a novena in it.
So I'm not an electrical engineer or hardware developer I'd like to initiate a comunity success here. I'm willing to get the final thing done by organizing the "production" like I did with the battery board.

If I understand it correctly all these keyboard/trackpoint things are one unit, but have seperated connections. From which one is the keyboard just "delivering" the bare matrix of the keys and the trackpoint delivers "some signals" (I honestly have no idea which..).
I also understand, that an arduino has some drawbacks:
- forces to send keys as letters instead of keycodes
- somwhat slow
- misses some combinations and special keys

So an other mc is a better choise, but at the moment only a cosed source for an adaptor is available.

Here is my idea: Setting up an hackaday project, so everyone can join in (by adding them as team member) and host the stuff on that wikipage, if bunnie don't mind.

and some rough ideas, how to get started:
-finding which connectors are used (and if the counterpart is still available)
-finding/ decoding the matrix itself (perhaps different for each keyboard. Can that perhaps be done with a adaptor to an arduino? (connecting it to one and having the sketch of the arduino telling me which wires are connected, while I press key)
-getting info how the trackpoint works

developing a connector board, which converts the trackpoint signals into mouse movement and the kayboard into keycodes.

I have some thinkpads lying around (560, 570, 600, T43 IIRC) and I'm willing to do the part I've done with the battery boards. but need someone doing the circuit and hardware design.

Anyone interested in starting this, too?

Re: internal thinkpad keyboard/trackpoint interface

The arduino libraries actually give you the ability to send the proper keystrokes - it is just not using the default interface.  The speed issues looked to be more specific to the particular implementation that was done, I could see a couple of ways that it looked like it could be speeded up (all theoretical, I didnt build that hardware to test it).

The specific layout of the matrix also appears not to have had major changes over the years, but there are always the regional layout variations and the small shuffling of keys between each model, so some tool for the changing of the matrix would be good.  I've actually got the matrix layout for the qwerty x220 and x230 keyboards - you can often extract this table from the firmware upgrade files.

I'm slowly trying to source some connectors, after which I will probably be building a quick and dirty adaptor (parhaps to an arduino, like you suggest) - while we have the connector pin out, I'm considering the exact pin functions are still only assumptions until I have actually seen it work.

For many years, the thinkpad keyboard has been arranged as a 16x8 matrix, so that is the minimum number of IO lines requred on your microcontroller for a working keyboard - The trackpoint adds another 3, the Fn and Power switch another two and the various LEDs add another 4, so to have every feature of the keyboard working, it will needs 35 IO lines.

I've got a bunch of ideas for circuit and hardware design, but so far they are still ideas...

PS. all that being said, the very first thing I did was purchase a lenovo external USB keyboard (part 55Y9003, lenovo Australia appears to have stock but not the US store) - tinkering with building my own is more of a long-term plan

Re: internal thinkpad keyboard/trackpoint interface

This is a great idea... too bad I already took the lazy USB approach. I'd still love to see it succeed, so...

The source for the aforementioned project is here: https://github.com/rampadc/arduino-thinkpadkb-usb

I haven't really looked at it, so it may or may not be complete or useful. It mentions speed issues. It seems likely that removing Arduino overhead could help a lot with those (again, haven't looked at it to know for sure).


As noted in the instructable (http://www.instructables.com/id/Make-a- … h-Arduino/), at least the ThinkPad T60 uses a JAE AA01B-S040VA1-R3000 connector . Apparently that's both hard to find and expensive, though I don't really see a way around it. I can confirm that it looks awfully similar to the connector found in my T400.

Alibaba returns a number of results for that part number, so you may have some luck there. They don't show any pictures, though, so I can't tell if it's actually the right part.

Re: internal thinkpad keyboard/trackpoint interface

Hi, I have done some work on this area before (disclosure: I wrote the instructables and github code you posted) and I think I should share some experience I've had with it.

So the hard part of this project is to get the receptacle that connects to the keyboard. It's expensive since they are proprietary and requires buying in bulk. Not all alibaba carries around this receptacle. They all say that they do but it's all lies. It took me several months to track down a few suppliers, which I don't think I have their contacts details anymore since it's been 2 years since I had dealing with them. If you guys are making a group effort, I'd recommend going through official JAE distributors. Or if you're game enough, you can use solid copper wires/magnetic wires with diameter of more than 30awg and solder them directly onto the keyboard connector - use a very fine tip and as low temperature as possible.

After getting the receptacle is to dig out the schematics for your keyboard connector. Have fun digging.

Using the Arduino Leonardo/Micro has has the disadvantage of having to use external I/O expanders as they do not have the required number of pins for interfacing with the keyboard: 16 rows + 8 cols + 3 trackpoint + 1 FN = 28. The reason why the Arduino implementation is slow is, I think, because of the expanders. If you're pursuing this, I recommend learning to program a USB supported microcontroller, either 8-bit or 32-bit. The 16-bit realm is very expensive for some reason. I personally use MSP430 because I've had experience with the chips before I started the project. I'd recommend reserving the UART pins for UART if you want to later expand the board to support interfacing with Bluetooth as well.

Microchip PIC18 would also work well, they are cheap, available in DIP packages and fairly straight forward to program. They don't have as many internal pull-up resistors however, so there would be a lot more external components.

The TrackPoint uses PS/2 mouse interface. Look up TrackPoint System Specifications version 4.

Once the hardware is sorted, it's all about programming.

I have sold a few USB interface boards for my T60 keyboard as they were leftovers from a successful implementation on Tindie. (forum doesn't allow more than 1 link so you'd have to search it up)

I'm slowly working on a Bluetooth implementation at the moment. It's not much different from the USB but since they are powered from a battery, the code and board would have to be optimized for low power consumption. Everything that I've had so far on this project is summarized here:
https://flashandrc.wordpress.com/catego … -keyboard/

Have fun with your crowd-sourcing. (The forum doesn't allow more than 1 links so I remove all the url tags)

Re: internal thinkpad keyboard/trackpoint interface

Here are my thoughts and questions:
Trackpoint:
- only 3 IO lines? (or is that the trackpoint itself, than 3 more for the buttons!?)
- or, as it has a PS/2 output, couldn't it use the UART lines of the arduino/mc?

Keyboard:
- matrix seems easy enought
- alternative to the connector: cut it of, blanken the wires and stick it to the connectors (yes custom ones in this scenario) with this stuff:
http://www.adafruit.com/products/1656
(have some of this. christmas gift of a fellow hacker)

General:
arduino (or the simelar mc) seems fine, if we use one with enough IO pins, as I understand it.

final goal (from my perspective). A arduino-like board (alike mc and open hardware) to which you stick your flex cable of the keyboard, upload the fitting sketch for you keyboard type and plug in the other end to usb.

I'm not sure about the keyboards, which have trackpoint and touchpad

and I'm not certain, if the keyboard should be seperated from the trackpoint and/or touchpad input (as in using one or 2 or 3 [in the tpuchpad scenario] USB port for that).

Setting up the testing scenario should be a messy adruino with a homebrewn adapterboard.

Oh, and for me open hard-/software is a must have.

Re: internal thinkpad keyboard/trackpoint interface

Here is the link to my project log about the foldable Palm Keyboard, which uses the z-axis conductive tape for connecting the ribbon wire to the PCB. If we could do something simmilar with the thinkpad keyboards, it would spare the whole expensive connector part..:
http://hackaday.io/project/3839-convert … ard-to-usb

Re: internal thinkpad keyboard/trackpoint interface

So, my efforts to prove that I know how to drive the raw keyboard are stalled while I search for connectors - I'm not sure I want to hand solder that connector more than once, so I'm not even looking at that until I know I cannot get connectors.  I've started asking for quotes, but I dont even know if they will deign to reply to my small order request.

The three IO for the trackpoint is indeed for the PS/2 signalling straight to that - and it includes the mouse buttons. I would just bit-bang it, as I want to use the Uart for the inevitable debugging.

For simplicity of testing, I would probably do a proof-of-concept for the keyboard and trackpoint interfaces separately, but - with enough IO - there is no reason why they couldnt all fit in one microcontroller (and thus use only one USB port)

Up until the X230, the keyboard unit (including trackpoint) is completely separate to the trackpad, so there is a separate  sub-assembly with the trackpad (which is also connected via a PS/2 port - I think the trackpoint actually daisy-chains out of the trackpad, but that is not needed to just make it work)

For keyboards on the X240 and X250, the trackpoint mouse buttons are provided via the trackpad, which makes that harder to use (additionally, I think they stuffed up the layout on those models).  Finally, as noted above, a lot of the thinkpad keyboards over the last ten years (or more?) use the same connector and a very similar layout, but the X240 and X250 keyboards use a completely different connector..

(There are a bunch of thinkpad models other than the "X" series, but I have not been paying close attention to what model numbers when with which keyboard type, so I'm just sticking with the X models I know)

Re: internal thinkpad keyboard/trackpoint interface

Do you know, if there is an usable component of the connector in any layout programm?
Perhaps it could be possible to fit the connector on the mentioned board for the Palm foldable keyboard (see my hackaday.io project link above).
This way we could do an universal PCB which works with the palm keyboards and (most) of the thinkpad keyboards. Only difference would be the software needed to load on it.

I just digged hardware stuff and happen to own a new spare keyboard from the 600 series. I'll exchange that with the very worn one on my 600 and will look into the idea to connect it without a connector (using the z-axes conductive double sided tape from 3M).

@rampadc:
do you have 1or 2 of the connectors with receptacle you could spare to help us? Or at least the exact name/discription of it?

Re: internal thinkpad keyboard/trackpoint interface

I actually have the part number for the socket that rampadc found: JAE AA01B-S040VA1-R3000, however it is not a simple to purchase product.  Octopart has four vendors listed, but they all want to provide a quote on request.

One of these has replied to me - they have a minimum order quantity of 100 pcs @ USD 1.90ea.  You might think that that is a high price, but I also asked for a quote on the matching plug (AA01B-P040VA1) and they are $12.98 each - with the same minimum order!  - So, I'm waiting a little for any other responses to my quote request, but I expect they will probably be a similar price..

Unfortunately, I think from looking at your photos that the palm keyboard has a shape that is different enough that the one connector would not fit on both

Re: internal thinkpad keyboard/trackpoint interface

hamish wrote:

[...]

One of these has replied to me - they have a minimum order quantity of 100 pcs @ USD 1.90ea.  You might think that that is a high price, ....

I thought more of that is a supprisingly low price. I would even thing about a lot of 500 pcs and ask for the possibility to get 1-3 sample parts for verification.

Unfortunately, I think from looking at your photos that the palm keyboard has a shape that is different enough that the one connector would not fit on both

Oh i wasn't clear enough. What I ment was a board which holds both connectors, from which only one is used (because they use mostly the same pins) and have the fitting software to drive any keyboard that is connected. Could even raise several additional use cases, if planned a bit sofisticated. (e.g. place holes for adding standard head pins...).

Re: internal thinkpad keyboard/trackpoint interface

mclien wrote:
hamish wrote:

[...]

One of these has replied to me - they have a minimum order quantity of 100 pcs @ USD 1.90ea.  You might think that that is a high price, ....

I thought more of that is a supprisingly low price. I would even thing about a lot of 500 pcs and ask for the possibility to get 1-3 sample parts for verification.

Somehow, I dont think I could make use of 500 connectors ...   I dont think I would find a use for 100 either, but at least that is not multiplying my parts hoard.

Good idea to ask for a sample.

Oh i wasn't clear enough. What I ment was a board which holds both connectors, from which only one is used (because they use mostly the same pins) and have the fitting software to drive any keyboard that is connected. Could even raise several additional use cases, if planned a bit sofisticated. (e.g. place holes for adding standard head pins...).

ah!, heh, yes - that makes a little more sense.  I actually figured that my test board would have the connections all brought out to another connector - just for making debugging simpler, so perhaps two birds with one stone?

Do you have shapes or measurements for any of the bits from the palm keyboard.  (Come to think of it, I have a couple of HP iPaq keyboards somewhere - I should try and crack them open and check the details there too)

Re: internal thinkpad keyboard/trackpoint interface

hamish wrote:

Somehow, I dont think I could make use of 500 connectors ...   I dont think I would find a use for 100 either, but at least that is not multiplying my parts hoard.

I'm willing to jump in here. If we think about making a good board that will work with a lot of thinkpads keyboards and will convert the Palm ones, I could think that 500 people may be interested.

ah!, heh, yes - that makes a little more sense.  I actually figured that my test board would have the connections all brought out to another connector - just for making debugging simpler, so perhaps two birds with one stone?

yes thats the basic idea. Mayby planing the debugging part as some "easy to break of" in case the board gets to big to fit in the plam keyboard otherwise.

Do you have shapes or measurements for any of the bits from the palm keyboard.  ..

I just removed the original PCB from the Palm Keyboard and hope to get the components removed till the weekend. Then I'll look for ways to digitize it for further use. There was a hint in the hackaday forum, which not compleetly understand:
http://forums.hackaday.com/viewtopic.ph … p;start=20
The post from Osgeld. But I don't understand exactly how to keep the scale with this method. And perhaps don't have a scanner with high enough resolution...

Re: internal thinkpad keyboard/trackpoint interface

I have figured out the measurements of the board and the connecting patterns, so I'm ready to start the next step, but there I have to find some help for the circuit design.
In general I think the best way is to use the schematics from the arduino nano (the atmega32u4 has USB built in) with connections to the following connectors:
- the one for the foldable keyboard (obviously)
- one for the thinkpad 600 and alike connectors (does anbody know of a source where alle the connector types are documented in  one place?)
- an area ready for plug connectors
- if enough space is left some other connectors for thinkpads
all connectors will share quite an amount of the same pins, but likly only one connector will be used per use case I'd guess

thinkpad connectors will be placed at the backside and will not be populated for the version that will be used inside the foldable keyboard.
holes for plug connector will be wired, but not populated in any case (easy enough to do by hand).

Another approch would be to only provide only soldering pads on the backside of the board and design daughter boards for any other connector...
usb connector will be micro USB for space reasons.

Re: internal thinkpad keyboard/trackpoint interface

The palm keyboard has a 12x8 Matrix, so 20 pins needed, which is exactly the amount an atmega32u4 used on arduinos is using.
The thinkpad keyboards will need more (about 35 according to hamish), so I'm back to quare one with the idea of making a"hybrid board" for both use cases. Basicly because I have very limited skills in circuit design, but copying the arduino nano schematics and adapt it to my little board will work.
So far I didn't found any arduino with a mc that has USB internal and 35+ I/O lines...
Your opinions to that?
Use another mc for the hybrid board idea or just make 2 boards?

Re: internal thinkpad keyboard/trackpoint interface

The Mega 2560 has enough I/O pins, but uses a separate ATmega16U2 as the USB interface. You could run the keyboard matrix scan code on the larger ATmega2560 chip, and just run a basic USB HID interface on the ATmega16U2 that provides the USB port?

The two have their UARTs connected together already on a mega2560, so I guess the effort just now is in making sure the ATmega16U2 is going to be happy with the HID code on it. Otherwise, this should work fine - just a shame it needs two uC's.

You could also just use a small atmega for USB and a decent pin-count CPLD to do the scan, of course. I think that'll actually work out more expensive, but it might be more novena-y, since people will be working in Verilog/VHDL for the FPGA anyway, so the CPLD will be familiar territory.

Re: internal thinkpad keyboard/trackpoint interface

Using two chips looks like an annoying answer - it adds effort to the code complexity, the cost and the build.  However, If you were going to use two chips, one option that looked good is to use an actual keyboard controller chip - I found the TI tca8424 (at £1.60 for qty 1) which is a I2C connected keyboard controller for embedded keyboards - it even generates the data in basically the same format as needed for the USB (it is a HID over I2C chip).  It doesnt handle the fancy way the "Fn" key is controlled on the thinkpad keyboards,  but everything else should just work.

I've been looking at non Atmel chips for this - looking mostly at various ARM cortex m0 chips - after a fair whack of research on the currently available micros, I've decided to try using the efm32zg222.  Which unfortunately doesnt quite have enough IO lines for the simplest design, but I expect to be able to work around that once I have a better idea of exactly how the keyboard is wired up (I can probably multiplex some of the LEDs together, but I need to be sure)

I have a dev kit for the ef32zg222 and it appears to work as advertised.  It is a low-power, low-price (~£1 each in low quantities) microcontroller which has an open source software-USB stack available.

I'm still arranging to get some keyboard connectors - which will allow me to build a rats-nest test rig to keep working at the keyboard reverse engineering.

I did a quick schematic design for this once I selected the parts, and nothing jumped out at me as being too strange (if you are interested http://www.zot.org/~hamish/hw/keyboard.pdf )  I have not started any PCB layout

So, my next steps are - wait for the connectors, then use them to both confirm the keyboard and check PCB layout measurements.

17 (edited by mclien 2015-03-02 22:41:32)

Re: internal thinkpad keyboard/trackpoint interface

At these atmel site:
http://www.atmel.com/products/microcont … gaavr.aspx
I found some uCs which seam to have USB and enough (48 programmable) I/O lines. Namely the AT90USB1286/7 and AT90USB646/7. (9x9mm as QFN package)
There are some xmega series who have the same pin number. I'm a noob on this, so forgive if that's nonsence.

I still don't know if it's a good idea to have this as an arduino compatible thing, perhaps not?

As to the PCB measurements -if we still think one PCB for thinkpad and palm is a good idea- I have now the compleed outline/ mounting holes and connector pads as dxf file (after some tedious work with an usb microscope and caliper).

Re: internal thinkpad keyboard/trackpoint interface

Dont worry, none of that is nonsense!  One big reason why not to use the atmel chips is in the price - the smallest of those four options (the AT90USB646) is ~£6.20, which is quite expensive for what you get.

I'm in two minds about the arduino compatibility:  Ultimately, it is a crutch that can make more advanced/efficient code difficult to achive - and can limit the hardware choices.  However, it can also make it easier for someone to start something new from scratch - I dont know how many people will be interested in using a keyboard interface as a "start from scratch" project, so I dont know if that gives much value.

I dont see why we should not at least try to make one PCB that would work for multiple different keyboards.  Once we start laying out the PCB, it should be pretty quick to see if all the parts will fit inside the mounting limitations.  Using some kind of daughter-board is just another way to make it more complex and hard to build.  It might end up just as simple to just have two circuit boards - one for each specific mounting point layoug.

I still expect to have make one board (at least) that is not size optimised and would not have all the right mounting points - just to give myself enough room for testing and debuging - so this is probably a problem that can be sorted out in time.  In fact, having a couple of revisions at the board make it simpler to itterate over ensuring the mechanical constraints are right.

Re: internal thinkpad keyboard/trackpoint interface

Actually, mclien - I've just gone and seen the more recent posts on your palm keyboard project, and I'm a little suprised to see just how small that circuit board is!  That could be quite a challenge to make it fit

How does the keyboard connect to the PCB connector?  Is that just a flexible-PCB that is glued tightly to the fingers of the connector on the controller board?  Is it possible to make the connector shorter do you think?  (and get some more board space)

That board size rules out using the large TQFP64 sized chips (like the AT90USB646) and it would be hard to fit the TQFP44 sized Atmega32U4, let alone a TQFP48 sized chip (like the efm32zg222 that I've been looking at).  You have obviously measured the space for QFN44 - I've been avoiding looking at anything QFN because I dont want to solder it!

Re: internal thinkpad keyboard/trackpoint interface

The connection to the keyboard is done by 3M doule-sided tape, which is conductive ony in z-axis. The flat-flex wires from the keyboard matrix sits dirctly on top. (think of is as glued instead of soldered).
Problem with shortening the pad is, that the housing holds the wires down on the end that sticks the most inside the board. It is possible to shorten the pads (and the wires accordenly), but could result in connectin problems (I think that's the reapon the soldered teensy variant failed partly).

To the Atmel/adruino/uC stuff I'm as devided as you. But if we keep it to keyboards and make the changing of the code easy for differen matrices of keyboards, I'm fine with non-arduino, too (more importent to me is CC and GNU licence).

To the board space: The backside is still an option. I could think of placing the uC there and have some of the inner layers to route (even the original board is at least 4 layers).  Backdraw is, that ther need to be cut an hole in the case, but it's easy enough to have a little ps- file as a cutting stencil done.

As to the QFN package: I won't mind to organize the population done by a professional service, as I did with the senoko boards.

To get started here is my idea: I'll do a prototyping board for the palm keyboard (pads in place and some breakout cable, simply making the matrix easier to access) and we start with your prototyping board. something like a double row of standard headers, where one is for each matrix part (perhaps I should visualize that..)

Anyway I have the dxf file of teh original measurement done.

Re: internal thinkpad keyboard/trackpoint interface

Sounds like a good starting point.

Looking at the numbers alone, it might just be possible to squeeze a tqfp48 into the space available - it has a 9mm square clearance - so not much more than the 7mm you have said is there.  Do you have a pinout handly for those j1,j2,j3,j4 connectors?

Re: internal thinkpad keyboard/trackpoint interface

So you think it's worth trying in the given space? Nice.
I sent you a forum mail with 2 links to the files.

Re: internal thinkpad keyboard/trackpoint interface

since you have the outline data, I think it is worth loading that up as a layer in the PCB design and seeing what it looks like - I'll try to give it a try this weekend.

Re: internal thinkpad keyboard/trackpoint interface

Well, my connectors arrived, so I can now try and build a rats-nest connection to the keyboard.

I also just noticed that the conversation with mclien petered out there, without me actually posting an update - for the record, the TQFP48 package I had in mind doesnt fit in the space he has available. So, I'm going to ignore that for the moment as we think of options.

I've also got most of an open source tool-chain going for the EFM32 microcontroller, with all the compiling and programming being done with standard debian packages (well, openocd needed to be upgraded to the current experimental version to support SWD - but thats still 'standard', right?).  The bit missing is that I still need to work through about a third of the Board-Support package and either remove it or work out its licences.

Re: internal thinkpad keyboard/trackpoint interface

hamish wrote:

Well, my connectors arrived, so I can now try and build a rats-nest connection to the keyboard.

Hey hamish - I started down the road of the usb thinkpad keyboard project, and also got stuck getting the connector. I have a dead thinkpad motherboard to work with, but I have no easy way to desolder the connector. So, my current approach is to cut out a chunk of the board containing the connector, and solder tiny wires into the tiny via holes, to break them out and connect them to my MC.

That's a really silly thing to do, so I'd love to avoid it if possible. I have to ask - can you give me any details about how you got the connectors? I don't expect you have any left, but if you do, I would gladly buy a few from you.