Close

Interfacing the PS/2 Keyboard to the Altair?

A project log for Project Seven

Bringing deep learning to platforms such as the Raspberry Pi, Parallax P2, or maybe an Altair 8800 for general robotics and other things.

glgormanglgorman 04/11/2023 at 23:310 Comments

Now that I am getting MIDI data with an actual piece of hardware, I am considering adding a PS2-compatible interface to some unused area of board real estate, for use of course with the Altair, when I get the MIDI sequencer software up and running in some sort of "stand-alone" mode.

Now what we are seeing here is what this particular IBM keyboard just so happens to put out, when I jam the "Num Lock" key, which contrary to what you might have heard, is processed just like any other key.  The difference between CAPS LOCK, and NUM lock, from other keys, therefore, is in how the PC responds when those keys are pressed, and that is by responding with some signals that tell the keyboard to turn certain lights on and off.  Now if we don't implement the bi-directional part of the protocol, and in effect only let the keyboard do the talking, then it appears that the keyboard is giving us eleven clock pulses for every key press, or repeated messages in case of s "stuck" key, as seen here; that is - along with the data which is on the data line.  That's it!  Oh, and of course mapping the IBM key codes back to ASCII, which is easily done in software.

Now this suggests to me that MAYBE I should try my hand at PS2 keyboard decoding using one of the available UARTs on my Altair 2SIO serial board, which of course right now has a fried baud rate generator chip, that I will have to find a replacement for, or else I will have to fabricate something custom, which I am also contemplating - in any case, since MIDI runs at 31250 bits/second, and that would require a 500 kHz UART clock, which is quite easily done by dividing the 2 Mhz Altair system clock by four with a 74HCT74, or else a 74HCT163.

Unfortunately, right now I only have one serial board (with two ports), so I will have to think of something else, if I want the Altair to support direct keyboard input, MIDI I/O, and have a PC connected via a USB dongle.

One of the nice things about the Parallax Propeller P1 chip is that it is available in a through-hole 40-pin version, so it is possible to contemplate designing an all-new board that at least looks like it could have been made in the late '70s, or early '80s.

So there is a method to some of the madness after all, and that is because of the principle of "design" reuse.  Thus I have "built something" so far that could evolve into a Pi hat or a stand-alone protocol converter, or maybe it could become a Commodore64 compatible cartridge, or maybe I could also have a PS2 converter for my Apple II, or maybe it could be a traditional Arduino form factor shield.

Discussions