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.

19 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!”

      1. It’s a generic Taiwanese Apple //e clone, they were made under a bunch of different names, with that board design. I’ve got one that’s branded as a “Hacker //e”.

        The STK chips aren’t just functional clones of the IOU and MMU – they’re actually ghost-shift versions of the NTSC version of the Apple IOU and MMU, so you could replace them with genuine Apple parts.

  2. (Fun fact, I have one of these same clones, although the case is slightly different and looks like some minor chip differences on the motherboard)

    That mystery ROM is definitely the character generator. Each character is an 8×8 binary representation and there are 256 of them. I don’t know what the remainder of the ROM contains though (might be junk). Quick python script to visualize it (see Max’s page for the ROM dump)

    import sys

    with open(sys.argv[1], “r”) as f:
    line = 0
    char_num = 0
    for c in
    if line % 8 == 0:
    print “Character %d” % char_num
    char_num += 1

    line += 1
    b = “{0:08b}”.format(ord(c))
    s = “”
    for c in reversed(b):
    s += ‘#’ if c == ‘1’ else ‘ ‘
    print s

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.