Which Teensie for Retro Keyboard Controller?

Status
Not open for further replies.
I'm planning to use a Teensie to build a keyboard interpreter for a 1980s computer case (a Sinclair QL, if anyone is interested). The keys are mapped onto a 11x9 grid, so it should be a simple matter to connect one side of grid to output pins and the other to inputs and send appropriate USB keystrokes based on the input.

Teensie 2.0 should be more than adequate for the job, but the price difference for Teensie 3.1 is minimal, and it seems tempting to have the ARM chip and extra RAM at my disposal.

Are there any disadvantages to overspecing and going for the more advanced board?

Thanks in advance for your help,

James
 
Sorry if I didn't give enough detail...

The Sinclair QL was Clive Sinclair's attempt to produce a business computer, after his success with home computers like the ZX81 and ZX Spectrum. It had a price point of £399 in 1984 when PCs started around £2000, so was pretty revolutionary. It also included a functional office suite, which definitely cost extra on PCs of the day. Unfortunately it was hit by production delays and reliability problems, particularly with the "Microdrive" alternatives to disk drives. Ultimately I think it failed because Sir Clive didn't understand that you can't treat the business market the same way as the hobby market.

But it was still a very beautiful computer:

sinclair-ql-large.jpg

As you can see, the keyboard was the entire computer, with the Microdrive cartridges slotting in to the right of the keyboard.

My plan is to replace the computing element with a Raspberry Pi, but I would like the keyboard to look like a regular USB keyboard.

Inside the case, the keyboard was connected to the motherboard by two ribbon connectors:

keyboard_orig_fit.jpg

These I plan to connect to the Teensie board, which will be connected to one of the Raspberry's USB ports. However, the first part of the project is just to make it work as a USB keyboard.

The following diagram shows the keyboard matrix:

ql_matrix.png

My understanding is I will need to configure the "J11" pins as outputs, and the "J12" pins as inputs. If I send a high signal out each J11 wire in turn and test for input on each J12 wire, it will tell me what key (or keys) has been pressed. I simply need to send the appropriate keystroke down the USB.

Is there any reason not to use a Teensy 3.1 for this?

Thanks for looking!

James
 
The main reason for not heading straight in with a T3.1 would be the lower operating voltage (3.3V) but given you are not doing anything else with it the keyboard will be fine. Also suggest looking at:

https://www.pjrc.com/teensy/td_libs_Keypad.html

Which should work off the shelf for what you are doing.

One thing you can probably do with the whatever board you chose is to have a power button that shuts down the PI and then drops the 5V supply off in a controlled sequence.

Edit - and Paul beat me to it on the keypad lib.
 
Last edited:
For only the 20 pins to the keys and USB, any Teensy should work.

If you decide to connect more stuff, of course you'll want more pins....
 
I remember desperately wanting a QL when it came out, since it looked way better than my 48k Spectrum. In retrospect, the promise of powerful 16(ish)bit processors and huge amounts of memory was greater than the actuality of fiddly videotape loop storage and a relatively short product lifespan. The indistrial design was nice though and using it as a retro keyboard is a nice idea.

As others have noted, the keypad library is designed for exactly this task. You tell the library how many rows and columns, and define a matrix to specify the character generated by each row and column combination. You already have that info in the diagram you posted.

One observation - at first glance this is an 11 by 9 matrix but looking closer it is actually a 8 by 8 matrix (columns 3 to 10 on J12, rows 1 to 8 on J11) plus three extra columns and one dedicated row for the modifier keys. I suggest wiring it up like that, so each position in the matrix corresponds to an actual character and the three extra lines, which you can read using a normal digital read, just give you shift states. Those need to be separately handled anyway by the USB keyboard code, so that makes it more convenient.
 
Nanronos,

Yeah, it seemed so sexy when it launched, but turned out to be a bit of a sheep in wolf's clothing. You could actually say 32ish rather than 16ish bits. The 68008 was a full 32 bit processor inside, but crippled by an 8 bit data bus. The microdrives were the real let down, though.

I'm planning to put SD card readers in the microdrive slots, and map the Pi's ports to the QL equivalents.

Thanks for all the tips. I'd picked the Teensy for the ease of simulations a USB keyboard, but I hadn't even spotted the keypad library, which seems perfect fir my needs. You're right that it's actually an 8x8 grid plus modifier keys.

There some oddities if the keyboard, such as the lack of a dedicated backspace key, which was achieved by pressing ctrl+ left arrow, so I'll have to do some coding to fill in the gaps. I'm thinking of having a switch to select between different modes of emulation, but I think the Teensy 3.1 should have more than enough channels to handle it.

I'll let you know how it goes!

James
 
Last edited:
Status
Not open for further replies.
Back
Top