Re-mapping the Key Matrix

A project log for USB Apple Extended Keyboard

An upgrade of the Apple Extended Keyboard I USB-ised in the mid 2000s

Julian CalabyJulian Calaby 11/22/2020 at 13:190 Comments

When I initially built this, I mapped out the matrix of the USB keyboard controller by attaching wires to the pads for the 8 rows and 18 columns to a bunch of switches and used those to map out the entire matrix.

I did this by building a piece of protoboard with 26 switches all wired to a common wire, then wiring the rows to 8 and the columns to the remaining 18. I could then simulate a key at a particula row and column by pressing the switches for the row and column simultaneously.

I wrote this up in an Excel spreadsheet which I've lost somewhere on one of the dead hard disks from my first computer.

I then cut traces and soldered wires to convert the matrix of the AEK into that particular matrix.

Now, 15 years later, I'm having to reverse-engineer the bits I need from that map by beeping out the keyboard.

I ended up with this:

(Colours indicate rows of physical keys, blank cells are rows and columns that don't have a corresponding key.)

I'm going to need to make some modifications to improve this to make the microcontroller selection a touch easier:

Then I also need to split the keypad equals key from the keypad enter key. I'll probably put it at row 4, column 14 so I don't have to re-solder both wires.

This leaves me with 8 rows and 15 columns requiring a total of 23 GPIOs to produce a total of 105 keys. Adding in the three LEDs, I need 26 GPIOs.

Frustratingly my LeoStick has only the Arduino standard 14 + 6 = 20 GPIOs and even if I use the 3 in the programming port, I'm still 3 GPIOs short, so I'm going to have to buy a microcontroller for this.