Some parallel ASCII keyboards
Posted: 21 Feb 2021, 05:37
Trying to fill the Covid lockdown with interesting vintage boards to find, restore, and convert means a steady stream of ones that use a simple parallel ASCII protocol. The idea is this: when a key is pressed, it is converted to US-ASCII by the keyboard and output as a 7-bit (sometimes wider) signal together with a strobe pulse.
This was quite common in the late '70s to early '80s inside / alongside terminals and similar equipment. Common enough that even back in those days there was a steady supply from surplus / overstock. So they were picked up for use by homebrew computers, where they were ideal because very little processing power or extra electronics is needed to get a character at a time into the program encoded the same way it would be in a file.
In fact, the very first issue of Byte magazine had an article, "Deciphering Mystery Keyboards". It pretty much only discusses this kind of keyboard. There is no mention of bit-serial encoding, raw scan codes, or of make and break codes.
These keyboards don't convert to a full modern USB keyboard, with their limited character repertoire. I make them CDC serial devices, which allows for a typing test where you can see what you typed. Even with all these limitations, there is a lot interesting going on from an engineering perspective and aesthetically.
I have posted about some of these before:
The first two of those old posts, on the Micro Switch SW-11234 and SD-16234 did not have pictures or have lost them. So here are some of those boards here: As I said, by the time 55SW5-2 got to me it had passed through Godbout. So it isn't too surprising that the last of those posts, the Maxi-Switch 216004, was being sold these days as part of somebody's hobbyist system (and hence historically valuable). In response to its wood-grain vinyl contact paper, mr_a500 posted a picture of a TEC terminal also with a keyboard in a metal box with that. I have managed to get hold of a TEC EKA-9542, which looks to be substantially the same, but without the wood-grain option. And for a keyboard in a metal box that really was sold to hobbyists (with grid switches that I believe were OEM rather than surplus), a Jameco JE610. Jameco is still in business; I buy parts from them all the time because they are close enough for USPS to have them here in a couple days.
Connectors
7 bits of ASCII + strobe + power + ground = 10 signals at least, which rules out some smaller connectors.
Some hobbyist interfaces shared a 2x8 DIP with a ribbon cable. But no standard layout of the pins there.
Which leads to this situation. These are essentially all the same converter, just with the signals at different places on the DIP socket.
As these hobbyist keyboards have become separated from their computers and as revival versions of the computers have been made, there is a market for a converter from a modern keyboard to this classic interface. But since the pinout is variable, there needs to be a place to put in jumpers as in this, which can still be bought here and on eBay, in two different configurations.
To go from a USB keyboard to parallel ASCII is even easier these days, if you use one of the Teensy's that has USB host support like this. Some level shifters are still needed since those have 3V GPIOs, though.
The Beehive B100 had a similar 2x9 DIP.
Other IDC ribbon cables with more standard headers had 20, 24, and 34 pins. The LK01 has a 40-pin header, but only 20 of the pins are connected, and those are in pairs, because it really only has the minimum 10 signals.
Sometimes a d-sub is used. The Honeywell BKBD has a female DB-25; having spent money on that connector, it is saved on the number of wires actually inside the cable that connected it to the terminal. The TEC EKA has a DC-37, but with only 17 connections for 15 distinct signals. That connector is so big that the Teensy converter fits inside the housing. Strobe Direction
There is no firm convention for whether the strobe line is idle high or low, that is, whether the trigger is rising or falling. Of course, most keyboards would pick whichever seemed easier. But the JE610, which might be put to use inside a variety of computers, exposes both directions on different pins, saving the other end of the interface an inverter if they needed it the other way.
Encoder
The simplest way to scan the key matrix for key presses, encode an ASCII character taking shifts into account, and strobe the output was using a custom MOS encoder for just this purpose.
The JE610, for instance, has one: Some examples of such MOS chips were:
The TEC EKA board does not have any programmable elements. All the encoding is done with 74-series TTL and a 555 timer to control the scan cycle. The Beehive B100 is similar, but with 256x4-bit of SRAM instead of a bunch of gates.
The Sanders Assoc 722 keyboard that was reverse engineered in the Byte article referred to above uses diodes to do the ASCII encoding, together with DTL logic for the strobe control. (And shift masking, I believe. I don't think diodes alone are sufficient to do that. The Cardco Cardkey external numpad only had diodes, which gave it a unique code for each key and a single any-key-pressed trigger.)
LEDs
Most of these keyboards do not have any lights. For one thing, that would be even more signals to pass, if sticking to a parallel protocol.
A few have a power LED or some kind of Carrier Detect / Data Set Ready indicator. These were terminals, or part of one. But today the PC is the terminal. So the ASCII keyboard converter is a modem. So I actually have these display Data Terminal Ready (i.e., does a program have /dev/ttyACM0 open) instead.
Many have an LED inside / under the CAPS LOCK key, but entirely under the control of the keyboard itself. This Micro Switch SC-15142 /63ST13-1 has a SHIFT LOCK key, that is one that shifts non-letters as well, which is just wired along with the SHIFT, as a result of which the LED lights when SHIFT is pressed, too. Which turns out to be very distracting (to me). The Console 262.4 is, in fact, the same PCB as the 262.3, but populating the UART and LEDs slots. The strobed parallel output from the encoder fills the UART's parallel-to-serial input. And the LEDs are lit directly from its serial-to-parallel output.
This Scientific Devices board has seven little LEDs right on the parallel output, so that they show the (LSB left, inverted) ASCII character while the key is held down. Bell / Buzzer
The TEC EKA keyboard has a signal whose falling edge triggers a one-shot to drive an alarm-style buzzer.
I can see no reason that a parallel ASCII boards could not add a pin connected directly to a speaker / piezo, though I don't seem to have one like that. It would be easy enough to PWM from the Teensy, as is done for some converters for other protocols.
Additional Outputs
Some keyboards have 8 strobed outputs instead of just 7 and encode some keys with the high bit set. For instance, the Amkey SNK-58.
The Micro Switch SC-15142 has a parity bit for the ASCII character. The JE610 has 8 bits of output and a 9th parity bit.
(Back a long time ago, like when these keyboards were new, we had specially modified DM2500's that set what the terminal thought was the parity bit directly from a meta key near space. This was supported by a few programs, including PDP-10 EMACS.)
Direct Keys
It is common for a few keys to be output directly, rather than scanned and ASCII encoded. Generally this is done by the switch connecting the signal to ground and the terminal having a pull-up. But the Maxi-Switch woodie actually has two signals for each of the switches it does directly.
Popular keys to do this was include the shifts, Shift, Ctrl, Caps Lock, which is easy, since the encoder tends to want these signals separate from the matrix to do the bit logic for shifting anyway.
Some others include Break, Clear, Here Is, and Reset, all of which would be special functions handled by the terminal, rather than just passed on to the host over RS-232. The Break and Reset keys sometimes have stronger springs in their switches.
The two direct keys on the JE610 do not have legends and are just called UD1 and UD2 in the documentation.
The Scientific Devices keyboard has 10 direct outputs, not all of which have legends, at least on the board I have worked with.
Break
The Break key on a terminal would be for sending a break signal over the serial line.
Many of these keyboards have some kind of repeat function, either a Repeat key or auto-repeat (typematic).
This was quite common in the late '70s to early '80s inside / alongside terminals and similar equipment. Common enough that even back in those days there was a steady supply from surplus / overstock. So they were picked up for use by homebrew computers, where they were ideal because very little processing power or extra electronics is needed to get a character at a time into the program encoded the same way it would be in a file.
In fact, the very first issue of Byte magazine had an article, "Deciphering Mystery Keyboards". It pretty much only discusses this kind of keyboard. There is no mention of bit-serial encoding, raw scan codes, or of make and break codes.
These keyboards don't convert to a full modern USB keyboard, with their limited character repertoire. I make them CDC serial devices, which allows for a typing test where you can see what you typed. Even with all these limitations, there is a lot interesting going on from an engineering perspective and aesthetically.
I have posted about some of these before:
- Micro Switch SW-11234 / 55SW5-2
- SD-16234 / 99SD24-3
- Micro Switch SD-16534 / 91SD30-3
- Consul 262.3
- DEC LK01
- Beehive B100
- Amkey SNK-58
- Maxi-Switch 216004
The first two of those old posts, on the Micro Switch SW-11234 and SD-16234 did not have pictures or have lost them. So here are some of those boards here: As I said, by the time 55SW5-2 got to me it had passed through Godbout. So it isn't too surprising that the last of those posts, the Maxi-Switch 216004, was being sold these days as part of somebody's hobbyist system (and hence historically valuable). In response to its wood-grain vinyl contact paper, mr_a500 posted a picture of a TEC terminal also with a keyboard in a metal box with that. I have managed to get hold of a TEC EKA-9542, which looks to be substantially the same, but without the wood-grain option. And for a keyboard in a metal box that really was sold to hobbyists (with grid switches that I believe were OEM rather than surplus), a Jameco JE610. Jameco is still in business; I buy parts from them all the time because they are close enough for USPS to have them here in a couple days.
Connectors
7 bits of ASCII + strobe + power + ground = 10 signals at least, which rules out some smaller connectors.
Some hobbyist interfaces shared a 2x8 DIP with a ribbon cable. But no standard layout of the pins there.
Which leads to this situation. These are essentially all the same converter, just with the signals at different places on the DIP socket.
As these hobbyist keyboards have become separated from their computers and as revival versions of the computers have been made, there is a market for a converter from a modern keyboard to this classic interface. But since the pinout is variable, there needs to be a place to put in jumpers as in this, which can still be bought here and on eBay, in two different configurations.
To go from a USB keyboard to parallel ASCII is even easier these days, if you use one of the Teensy's that has USB host support like this. Some level shifters are still needed since those have 3V GPIOs, though.
The Beehive B100 had a similar 2x9 DIP.
Other IDC ribbon cables with more standard headers had 20, 24, and 34 pins. The LK01 has a 40-pin header, but only 20 of the pins are connected, and those are in pairs, because it really only has the minimum 10 signals.
Sometimes a d-sub is used. The Honeywell BKBD has a female DB-25; having spent money on that connector, it is saved on the number of wires actually inside the cable that connected it to the terminal. The TEC EKA has a DC-37, but with only 17 connections for 15 distinct signals. That connector is so big that the Teensy converter fits inside the housing. Strobe Direction
There is no firm convention for whether the strobe line is idle high or low, that is, whether the trigger is rising or falling. Of course, most keyboards would pick whichever seemed easier. But the JE610, which might be put to use inside a variety of computers, exposes both directions on different pins, saving the other end of the interface an inverter if they needed it the other way.
Encoder
The simplest way to scan the key matrix for key presses, encode an ASCII character taking shifts into account, and strobe the output was using a custom MOS encoder for just this purpose.
The JE610, for instance, has one: Some examples of such MOS chips were:
- National MM5740/AAx, with /AAC, /AAD, and /AAE layout variants (at least that I have -- there was also a MM57499 with the same matrix inputs and TTL serial output).
- GI AY-5-2376 and SMC KR2376 for 88 keys.
- GI AY-5-3600 and SMC KR3600 for 90 keys. 3600 is the number of bits in the ROM. Plus there are similar (same pinout, different ROM contents) models like an SMC 3603.
- AMI S9201 Dynamic Keyboard Encoder, whose datasheet includes the format of the 91 punchcards (90 keys plus end card) used to customize the ROM.
- Tesla MH103, inside the Consul, a clone of some AMI chip, I believe.
The TEC EKA board does not have any programmable elements. All the encoding is done with 74-series TTL and a 555 timer to control the scan cycle. The Beehive B100 is similar, but with 256x4-bit of SRAM instead of a bunch of gates.
The Sanders Assoc 722 keyboard that was reverse engineered in the Byte article referred to above uses diodes to do the ASCII encoding, together with DTL logic for the strobe control. (And shift masking, I believe. I don't think diodes alone are sufficient to do that. The Cardco Cardkey external numpad only had diodes, which gave it a unique code for each key and a single any-key-pressed trigger.)
LEDs
Most of these keyboards do not have any lights. For one thing, that would be even more signals to pass, if sticking to a parallel protocol.
A few have a power LED or some kind of Carrier Detect / Data Set Ready indicator. These were terminals, or part of one. But today the PC is the terminal. So the ASCII keyboard converter is a modem. So I actually have these display Data Terminal Ready (i.e., does a program have /dev/ttyACM0 open) instead.
Many have an LED inside / under the CAPS LOCK key, but entirely under the control of the keyboard itself. This Micro Switch SC-15142 /63ST13-1 has a SHIFT LOCK key, that is one that shifts non-letters as well, which is just wired along with the SHIFT, as a result of which the LED lights when SHIFT is pressed, too. Which turns out to be very distracting (to me). The Console 262.4 is, in fact, the same PCB as the 262.3, but populating the UART and LEDs slots. The strobed parallel output from the encoder fills the UART's parallel-to-serial input. And the LEDs are lit directly from its serial-to-parallel output.
This Scientific Devices board has seven little LEDs right on the parallel output, so that they show the (LSB left, inverted) ASCII character while the key is held down. Bell / Buzzer
The TEC EKA keyboard has a signal whose falling edge triggers a one-shot to drive an alarm-style buzzer.
I can see no reason that a parallel ASCII boards could not add a pin connected directly to a speaker / piezo, though I don't seem to have one like that. It would be easy enough to PWM from the Teensy, as is done for some converters for other protocols.
Additional Outputs
Some keyboards have 8 strobed outputs instead of just 7 and encode some keys with the high bit set. For instance, the Amkey SNK-58.
The Micro Switch SC-15142 has a parity bit for the ASCII character. The JE610 has 8 bits of output and a 9th parity bit.
(Back a long time ago, like when these keyboards were new, we had specially modified DM2500's that set what the terminal thought was the parity bit directly from a meta key near space. This was supported by a few programs, including PDP-10 EMACS.)
Direct Keys
It is common for a few keys to be output directly, rather than scanned and ASCII encoded. Generally this is done by the switch connecting the signal to ground and the terminal having a pull-up. But the Maxi-Switch woodie actually has two signals for each of the switches it does directly.
Popular keys to do this was include the shifts, Shift, Ctrl, Caps Lock, which is easy, since the encoder tends to want these signals separate from the matrix to do the bit logic for shifting anyway.
Some others include Break, Clear, Here Is, and Reset, all of which would be special functions handled by the terminal, rather than just passed on to the host over RS-232. The Break and Reset keys sometimes have stronger springs in their switches.
The two direct keys on the JE610 do not have legends and are just called UD1 and UD2 in the documentation.
The Scientific Devices keyboard has 10 direct outputs, not all of which have legends, at least on the board I have worked with.
Break
The Break key on a terminal would be for sending a break signal over the serial line.
- This might send a unique code and the terminal does the serial work.
- The Break key can just be another direct key and the terminal asserts break while it is pressed.
- A timer inside the keyboard can turn a Break press into a pulse of a few hundred milliseconds.
- The BREAK key on the JE610 just sends a null character, since it isn't really a terminal.
Many of these keyboards have some kind of repeat function, either a Repeat key or auto-repeat (typematic).
- This can be done entirely inside the keyboard, with the strobe pulse repeating periodically so long as a key is pressed, and enabled by the Repeat key if there is one.
- The keyboard can have an any-key-down output signal and the terminal can repeat the last-seen character so long as that is on.
- The Repeat key can then just be another direct key that the terminal uses it to enable this.
- The keyboard can have an input signal that acts as a repeat clock, triggering another strobe on its edge if a key is still pressed.
- Or the terminal can send a delayed "ack" of a key press, triggering the same action.