Using an Arduino to Re-Create a Computer’s Keyboard Decoder

[Max Breedon] found an old Apple IIe clone twenty years ago. He recently dug this Epson AP-200 out of the salvage heap and quickly discovered that the keyboard decoder chip was fried. The old chip was way too obscure to source a replacement — and soon this post will be the top Google result for the string, ‘C35224E’ — so he busted out his trusty UNO and created a replacement keyboard decoder.

Unlike the Apple II, where all the keyboard decoding happens on the keyboard, this clone used a dedicated chip on the main board. Although it’s a rare part that’s virtually ungoogleable, this chip’s architecture and pinout can be figured out by testing out every trace for continuity. After locating what looked like four data pins, he had the Arduino send signals onto the clone to see what characters popped up. That didn’t work, but it led him to idea that two of the wires were clock and data, and after a bit of experimenting figured out that the third pin was a latch enable of some sort that sent the character.

So, [Max] created an Arduino rig to do the same thing. The Arduino uses a shift register to interact with the keyboard’s 8×10 matrix, and the sketch translates any serial data it receives into the keypresses the clone is expecting. After prototyping with the UNO, [Max] hardwired an Arduino Nano (as well as the shift register) into a daughter board with pins extending into the old chip’s sockets. A permanent solution!

In addition to a weird keyboard controller that has been lost to the sands of time, this Apple IIe clone features a few more parts that are downright weird. There are two chips that are found in a few other Apple clones labeled STK 65301 and STK 65371, used as ASICs, MMUs, or a 20-IC expression of Wozzian brilliance condensed into custom silicon. There’s another weird chip in this clone, a 27c32 ROM loaded up with repetitive bits. There is no obvious 6502 code or strings in this ROM, so if anyone has an idea what this chip does, send [Max] a note.

17 thoughts on “Using an Arduino to Re-Create a Computer’s Keyboard Decoder

  1. My favorite use of an eprom from ‘back in the day’ was to convert EBCDIC to ASCII or vice-versa, feed the address line ASCII to get EBCDEC out the data bits.

    My money is on character generator – feed in ASCII in address lines A3 to A10 and bit patterns for each of the 8 lines of the character are accessed by iterating through the 8 possibilities of A0-A2.

    1. Actually 7×8 charset. Either Normal & Inverse or Upper & Lower. The Apple II/II+ used a 32kbit rom and stored 4 copies of the font, adding a Flashing character set using the 8th bit from each row. The IIc changed this to Upper & Lowercase and MouseText.

    1. I reckon you are right: if two keys on the same column were held down at the same time, that a high on the 595 row scan would be shunted back to the low output of a low 595 row.

      I’ll worry about that in 20 years when I dig it out of the attic again.

    1. Large percentages of the Apple II roms were copied in mass by clones of the period. Several Apple II clones changed only the “Apple ][” greeting. This is what led to the Macintosh easter egg where you could hit the programmer’s switch and call a routine to draw the pirate mac icon. Jobs wanted to be able to pull a clone maker into court and very dramatically pull up the pirate mac icon to say “SEE! They STOLE from us!”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s