KBT Pure firmware/controler

Hello,

I'm actually a HHKB Pro 2 owner and while i love this keyboard i really wanted to try a cherry switch keyboard.
Also HHKB is pretty limited in terms of customization.

So as i can't type on a bigger sized keyboard anymore, and i wanted to give a try to something else, i bought a Pure.
Thing is, i already dislike how some of the keys are placed on the layout - particularly the Fn key as using an European keymap it should be switched with Alt_r.

Anyway, i found that it was a good start to start hacking on a Teensy... And so i wanted to ask the more knowledgeable people about it and the firmware.
Are the Pure's firmware sources available somewhere? Should i go for a Tensy or a Teensy++? Which opensource firmware one would advise me to start with as a base - Yeah usually easier than to start from scratch :lol: ?


Thanks in advance for your answers,
Coredumb
coredumb

Unread post11 Dec 2012, 17:34

X
coredumb
 
Posts: 51
Joined: 11 Dec 2012, 16:03
Main keyboard: HHKB Pro2
Main mouse: Evoluent vertical
Favorite switch: Dunno yet :)
Club member: -
 
So i have received it and controler is apparently a http://www.holtek.com.tw/english/docum/ ... 82k94x.htm chip.
Was looking around the vendor site but not sure if there's an easy way with official tools to reprogram it.

Any advice?
coredumb

Unread post20 Dec 2012, 19:11

X
coredumb
 
Posts: 51
Joined: 11 Dec 2012, 16:03
Main keyboard: HHKB Pro2
Main mouse: Evoluent vertical
Favorite switch: Dunno yet :)
Club member: -
 
HT82K94E is one time programmable device. You could try to get a replacement IC and program it youself, but you'd be on your own for the firmware.
laffindude

Unread post21 Dec 2012, 01:10

X
laffindude
 
Posts: 74
Joined: 30 May 2012, 15:46
Club member: -
 
Ok thanks for the info.
I think the first "easy" task would be to rewire some keys, though that wouldn't solve the Fn layout.
coredumb

Unread post21 Dec 2012, 07:40

X
coredumb
 
Posts: 51
Joined: 11 Dec 2012, 16:03
Main keyboard: HHKB Pro2
Main mouse: Evoluent vertical
Favorite switch: Dunno yet :)
Club member: -
 
Same problem here. Going from HHKB (lite) to Pure -> layout problems. Did you find a solution?
relcc

Unread post03 Jan 2013, 20:36

X
relcc
 
Posts: 13
Joined: 28 Dec 2012, 02:49
Location: Amsterdam, the Netherlands
Main keyboard: HHKB
Main mouse: Logitech
Favorite switch: Topre
Club member: -
 
I ordered a teensy - two actually cause i'll eventually break one :D - and plan to set it up in place of the HT82K94E controller.

Have to gather some more informations, see how i'm gonna detect the Pure Matrix, and hope i don't make the board unusable :D (Which may very well happen as seeing how the actual controller is placed i'll have to cut tracks)

I'll give all information when i start - for now i'm moving house and it doesn't let me do anything on that.
coredumb

Unread post05 Jan 2013, 14:07

X
coredumb
 
Posts: 51
Joined: 11 Dec 2012, 16:03
Main keyboard: HHKB Pro2
Main mouse: Evoluent vertical
Favorite switch: Dunno yet :)
Club member: -
 
So glad you're taking this on and eager to hear about your progress after the move.

Thank you!
mashby
User avatar

Unread post05 Jan 2013, 17:30

User avatar
X
mashby
 
Posts: 418
Joined: 11 Dec 2012, 19:06
Location: Nashville, TN USA
Main keyboard: KBC Poker (MX-Black)
Main mouse: Apple Magic Trackpad
Favorite switch: Buckling Spring
Club member: -
 
 
Hope to find time this month to start hacking on this :)
coredumb

Unread post05 Jan 2013, 18:50

X
coredumb
 
Posts: 51
Joined: 11 Dec 2012, 16:03
Main keyboard: HHKB Pro2
Main mouse: Evoluent vertical
Favorite switch: Dunno yet :)
Club member: -
 
Sounds like an interesting project. Would you like some help?

I've recently done something similar with an old Wyse terminal keyboard, i.e. remove the controller and replace it with a Teensy 2. Wyse terminal keyboards are beautiful old machines, but they're not even close to being PC-compatible. However, now with a Teensy and some firmware I have a rather novel USB keyboard!

I went looking for customisable firmware, but what I found out there wasn't easy to modify. Given some random keyboard and the existing firmware, it simply wasn't obvious what to do next. So I wrote my own, with the main theme being customisability for different types of keyboard. My code is on GitHub: a project called clavis. It's a work in progress: still quite new and the documentation isn't complete.

So if you're interested, we could work together. I can deal with the firmware side and give you advice on what to do with the hardware. What do you think?
urbanus
User avatar

Unread post06 Jan 2013, 05:03

User avatar
X
urbanus
 
Posts: 33
Joined: 30 Jun 2012, 03:31
Location: Sydney, Australia
Main keyboard: Cherry G80-1000
Main mouse: Logitech M500
Favorite switch: Capacitive buckling spring
Club member: -
 
Oh very much appreciated!! I can also code a bit for the firmware part, i'm more worried by the matrix and controler replacement actually.
I'll send you my details by PM if you want. I gues you'd like some HD shots of the board?
coredumb

Unread post06 Jan 2013, 12:37

X
coredumb
 
Posts: 51
Joined: 11 Dec 2012, 16:03
Main keyboard: HHKB Pro2
Main mouse: Evoluent vertical
Favorite switch: Dunno yet :)
Club member: -
 
I've been messing around with the Poker, a slightly smaller keyboard than the Pure.

I couldn't really replace the controller by a Teensy as the controller's solder traces are very fine, it's very hard to solder loose wires to those traces without making contact with the trace next to it. In the end, I started looking at using the original controller in PS/2 mode and then connecting a Teensy with Soarer's converter to remap all stuff. The newest version has support for Fn keys, so I disconnected the Fn key from the Poker controller and hooked it directly into to the Teensy. The setup works, but building it all into the keyboard is proving to be troublesome - the plastic case has little spare room.
JBert

Unread post06 Jan 2013, 12:55

X
JBert
 
Posts: 1091
Joined: 10 Mar 2011, 23:02
Location: Belgium, land of Liberty Wafles and Freedom Fries
Main keyboard: G80-3K with Clears
Favorite switch: Capacitative BS
Club member: 0049
 
Yeah i saw that the traces are very thin, the first of my worries actually
coredumb

Unread post06 Jan 2013, 13:06

X
coredumb
 
Posts: 51
Joined: 11 Dec 2012, 16:03
Main keyboard: HHKB Pro2
Main mouse: Evoluent vertical
Favorite switch: Dunno yet :)
Club member: -
 
coredumb wrote:Oh very much appreciated!! I can also code a bit for the firmware part, i'm more worried by the matrix and controler replacement actually.

You're planning on replacing the matrix as well? Not saying that's a problem -- it's just more work. One good argument in favour is if the existing matrix doesn't feature diodes. In that case reimplementing the matrix is a definite plus, especially if you plan to use the board for gaming.

However the least intrusive approach is to work with the existing matrix, and isolate/remove the existing controller.
coredumb wrote:I'll send you my details by PM if you want. I gues you'd like some HD shots of the board?

Sure, that would be great. I'll PM mine.
urbanus
User avatar

Unread post06 Jan 2013, 19:06

User avatar
X
urbanus
 
Posts: 33
Joined: 30 Jun 2012, 03:31
Location: Sydney, Australia
Main keyboard: Cherry G80-1000
Main mouse: Logitech M500
Favorite switch: Capacitive buckling spring
Club member: -
 
JBert wrote:I couldn't really replace the controller by a Teensy as the controller's solder traces are very fine, it's very hard to solder loose wires to those traces without making contact with the trace next to it.

Is the controller surface mounted? If so then yeah, soldering onto that by hand would be very hard. Don't want to go there.

I would suggest a different approach: after analysing the matrix, isolate the controller by cutting its traces. Then when wiring in the Teensy, use hookup wire to connect the pins of the Teensy to the appropriate pin of the first Cherry MX switch in the row/column. That will be a very easy point onto which you can solder.
urbanus
User avatar

Unread post06 Jan 2013, 19:14

User avatar
X
urbanus
 
Posts: 33
Joined: 30 Jun 2012, 03:31
Location: Sydney, Australia
Main keyboard: Cherry G80-1000
Main mouse: Logitech M500
Favorite switch: Capacitive buckling spring
Club member: -
 
Oh no i mean matrix discovery, i don't plan on replacing it :)
As for the soldering, yeah my plan was to cut traces sounds like the easier approch... Also try to move away from the controler where there's more space.
coredumb

Unread post06 Jan 2013, 19:17

X
coredumb
 
Posts: 51
Joined: 11 Dec 2012, 16:03
Main keyboard: HHKB Pro2
Main mouse: Evoluent vertical
Favorite switch: Dunno yet :)
Club member: -
 
Soldering on the Pure is actually quite easy if you attach wires to the keys directly. The controller can be removed. There is another chip whcih may be a driver for the leds, but as you come from the HHKB you probably dont care about the leds. You even may be able to reuse the usb connector on the Pure.
relcc

Unread post06 Jan 2013, 22:11

X
relcc
 
Posts: 13
Joined: 28 Dec 2012, 02:49
Location: Amsterdam, the Netherlands
Main keyboard: HHKB
Main mouse: Logitech
Favorite switch: Topre
Club member: -
 
Yeah the LEDs will wait :)
As for the connector.... Well i don't mind a bit of relocation
coredumb

Unread post06 Jan 2013, 23:08

X
coredumb
 
Posts: 51
Joined: 11 Dec 2012, 16:03
Main keyboard: HHKB Pro2
Main mouse: Evoluent vertical
Favorite switch: Dunno yet :)
Club member: -
 
I made some progress today on Clavis. To make the KBT Pure project happen, we need to be able to translate the meaning of the keys depending on whether the "fn" key is pressed. ("fn" is not a USB key sent to the host: it is for the controller's use only, to reinterpret the keys being pressed.)

To that end, I added a feature I call "hacks". It's basically a function pointer you can optionally provide, which gets called any time the keys have changed. In your hack function, you can do things such as check which keys are currently pressed and modify the matrix. This makes the implementation of "fn" easy: if "fn" is pressed, change the "1" key to "F1", "2" to "F2" etc. etc., and when not pressed change them back to their normal meanings.

I'll be interested to see your results when you've analysed the matrix. Then we can start cutting the code! (And traces... and warranty :o ).
urbanus
User avatar

Unread post08 Jan 2013, 11:00

User avatar
X
urbanus
 
Posts: 33
Joined: 30 Jun 2012, 03:31
Location: Sydney, Australia
Main keyboard: Cherry G80-1000
Main mouse: Logitech M500
Favorite switch: Capacitive buckling spring
Club member: -
 
coredumb wrote:Yeah the LEDs will wait :)

Out of interest, are we talking about the indicator LEDs or backlighting? If backlighting, how does that work? Teensy provides 5V of course, if that helps. Or is it something more sophisticated (brightness control etc.)?
urbanus
User avatar

Unread post08 Jan 2013, 11:09

User avatar
X
urbanus
 
Posts: 33
Joined: 30 Jun 2012, 03:31
Location: Sydney, Australia
Main keyboard: Cherry G80-1000
Main mouse: Logitech M500
Favorite switch: Capacitive buckling spring
Club member: -
 
I have analysed the matrix, merged some rows, modded ther PCB for 2 buttons instead of backspace and added a Teensy and modded the (plastic) case yesterday. I will post my findings, the matrix and pictures later today. I might do some programming on the Teensy this evening.
relcc

Unread post08 Jan 2013, 11:22

X
relcc
 
Posts: 13
Joined: 28 Dec 2012, 02:49
Location: Amsterdam, the Netherlands
Main keyboard: HHKB
Main mouse: Logitech
Favorite switch: Topre
Club member: -
 
Wow excellent!! Show us all that :)
@urbanus i think we were referring to backlighting, though i don't care much about the indicator LEDs.

As i haven't had time to look at the board, i'm really interested by what @relcc modded
coredumb

Unread post08 Jan 2013, 11:41

X
coredumb
 
Posts: 51
Joined: 11 Dec 2012, 16:03
Main keyboard: HHKB Pro2
Main mouse: Evoluent vertical
Favorite switch: Dunno yet :)
Club member: -
 
Here are some of my findings. I used a multimeter to chart the columns and rows of the PURE PCB. I used (colored) letters for the columns (the ones that are connected directly to the keys), and numbers for the rows (the ones that are connected via a diode).

pure_re.png
Reverse engineering the matrix of the KBT Pure


The chip on the right is the controller, the one on the left is probably the led driver. Mosdt likely this is connected using i2c or spi to the driver. For hacking the keyboard using a Teensy I leave the chips in place. Only the Teensy is powered, the existing chips are not. If I cannot scan the keys correctly I would most likely try to remove the controller. If you would like to re-use the led circuit, you would have to remoev the controller and hookup the led driver to the teensy as well.

If I chart the matrix of the above findings, I get the following matrix:

keymap.png
Matrix of the KBT Pure


The connections to the ports of the HT52K94E are also shown, next to the connections to the ports that I used on the Teensy. Of course you are free to connect to other ports.

Some of the rows may be overlapped with others, to decrease the number of rows used. It is not necesarry, as the Teensy has enough ports, but I combined some of the rows to decrease IO used. The hardware mapped keys are shown in red. In the first picture the mapping (combining of rows) is hown with 4 yellow connections. The fourth is between two pins of the controller.

In blue is an extra key I added, as I like to have two keys instead of the backspace, to mimic the layout of the HHKB.

IMG_2544.JPG
Added key, top view

IMG_2545.JPG
added key, bottom view


After connecting all the rows and columns to the Teensy I get the following result:
IMG_2543.JPG
Teensy added


Next was some case modding to fit the PCB with Teensy in the (temporay) original case. This is mainly for providing space for the connections, the Teensy itself, a hole to reach the reset button and a hole for another USB cable, since the original USB connector is not used:
IMG_2547.JPG
Simple case modding


The finished product looks just like the original KBT Pure, but with two buttons top right. Next is providing software for the Teensy to make the keyboard do what I want, and waiting for my key caps to be delivered.
Last edited by relcc on 10 Jan 2013, 18:25, edited 2 times in total.
relcc

Unread post08 Jan 2013, 20:53

X
relcc
 
Posts: 13
Joined: 28 Dec 2012, 02:49
Location: Amsterdam, the Netherlands
Main keyboard: HHKB
Main mouse: Logitech
Favorite switch: Topre
Club member: -
 
Impressive :O
coredumb

Unread post08 Jan 2013, 21:06

X
coredumb
 
Posts: 51
Joined: 11 Dec 2012, 16:03
Main keyboard: HHKB Pro2
Main mouse: Evoluent vertical
Favorite switch: Dunno yet :)
Club member: -
 
The keyboard is now fully functional using an adaptation of the tmk_keyboard source files. Still awaiting new keycaps...
relcc

Unread post10 Jan 2013, 18:28

X
relcc
 
Posts: 13
Joined: 28 Dec 2012, 02:49
Location: Amsterdam, the Netherlands
Main keyboard: HHKB
Main mouse: Logitech
Favorite switch: Topre
Club member: -
 
The final result with key caps

img_2608.jpg
relcc

Unread post01 Feb 2013, 11:21

X
relcc
 
Posts: 13
Joined: 28 Dec 2012, 02:49
Location: Amsterdam, the Netherlands
Main keyboard: HHKB
Main mouse: Logitech
Favorite switch: Topre
Club member: -
 
ui, looks very nice. What kind of keycaps are they?
CeeSA
User avatar

Unread post01 Feb 2013, 12:04

User avatar
X
CeeSA
 
Posts: 1579
Joined: 30 Jan 2011, 13:19
Location: Bonn, Germany
Main keyboard: Deck 82 modded
Main mouse: WMO
Favorite switch: Cherry MX Blue
Club member: 0016
 
Those are wasdkeyboards.com . My own design
relcc

Unread post01 Feb 2013, 17:25

X
relcc
 
Posts: 13
Joined: 28 Dec 2012, 02:49
Location: Amsterdam, the Netherlands
Main keyboard: HHKB
Main mouse: Logitech
Favorite switch: Topre
Club member: -
 
It's a amazing mod and result.
Thanks for sharing the code.
Gilgam
User avatar

Unread post01 Feb 2013, 20:57

User avatar
X
Gilgam
 
Posts: 1080
Joined: 22 Feb 2011, 22:59
Location: france
Main keyboard: Too many
Main mouse: CST trakball
Favorite switch: red ?, maybe topre, well no, black... Or brown???
Club member: -
 
@relcc Awesome :)
I really need to find some time to start this....
coredumb

Unread post02 Feb 2013, 17:33

X
coredumb
 
Posts: 51
Joined: 11 Dec 2012, 16:03
Main keyboard: HHKB Pro2
Main mouse: Evoluent vertical
Favorite switch: Dunno yet :)
Club member: -
 
relcc wrote:Those are wasdkeyboards.com . My own design

That's funny, I was designing some Dolch Replica/Round 3 style caps on their site just today!

You don't recall what size font you used on the alpha keys do you?
mashby
User avatar

Unread post03 Feb 2013, 05:06

User avatar
X
mashby
 
Posts: 418
Joined: 11 Dec 2012, 19:06
Location: Nashville, TN USA
Main keyboard: KBC Poker (MX-Black)
Main mouse: Apple Magic Trackpad
Favorite switch: Buckling Spring
Club member: -
 
 
Next

Who is online

Users browsing this forum: codemonkeymike, Findecanor, Gnohio, Vecktrex, vulup and 58 guests