I’ve been using an ergonomic keyboard for a few years now. Specifically, one of several models of the Matias Ergo Pro. I say “one of several” because a few of these have broken on me. Luckily, Matias support has been easy to work with and have sent me replacements and given me discounts. While my most recent keyboard has had no issues, I am left with a pile of old keyboard hardware. Most of the issues were with USB in the right half of the board, so the left halves of the are presumably fine. Let’s make something out of them!
The keyboard halves are connected though a 3.5mm TRRS jack. I reached out to Matias to ask what protocol they used, but was told the left half of the boards didn’t contain any active circuitry and simply “expanded the key matrix.” Multiplexing all of those keys on only 4 connections is impossible so I was a bit suspicious. Lo and behold: when I cracked open the enclosure I found a microcontroller. Oh well. Can’t expect them to give me design secrets just like that.

The MCU in question is a SN8F26E65 by SONIX. Looking at the datasheet I found the following pinout:

According to the pinout, the halves could be using I2C or UART (pins 27/28). I thought I2C was more likely for chips communicating inside a singular product. I hooked up my logic analyzer and got the following:

Almost entirely gibberish – not very encouraging. And hey look – no clock! That’s weird. I only get pulses on that line when I press CAPSLOCK. Could these actually be RX and TX lines?

It’s a UART, with data only sent back to RX when the left keyboard half has to turn the CAPS light on. I futzed around until I determined the baud rate and encoding. Here’s what I came up with:
key | press | release |
` | 07 | C7 |
1 | 08 | C8 |
2 | 10 | D0 |
3 | 98 | 58 |
4 | 00 | C0 |
5 | 1F | DF |
q | 01 | C1 |
w | 89 | 49 |
e | 91 | 51 |
r | 19 | D9 |
t | 1A | DA |
a | 83 | 43 |
s | 0B | CB |
d | 13 | D3 |
f | 9B | 5B |
g | 1C | DC |
z | 85 | 45 |
x | 0D | CD |
c | 15 | D5 |
v | 9D | 5D |
b | 9E | 5E |
esc | 04 | C4 |
undo | 84 | 44 |
cut | 88 | 48 |
copy | 03 | C3 |
paste | 82 | 42 |
fn | 05 | C5 |
tab | 02 | C2 |
caps | 8A | 4A |
shift | 0A | CA |
ctrl | 17 | D7 |
win | 14 | D4 |
alt | 86 | 46 |
space | 0E | CE |
F1 | 8F | 4F |
F2 | 97 | 57 |
F3 | 92 | 52 |
F4 | 94 | 54 |
The pattern relating press to release is RELEASE = PRESS XOR C0
. I plan to use this information to make a module that I can connect the keyboard half to (without modifying the original hardware). Then I can potentially make another useful keyboard! Stay tuned for updates.