Sinclair ZX Spectrum (rubber keys) Pi retro fit


15 posts
by kevleyski » Tue Feb 14, 2012 8:08 pm
I have an old ZX Spectrum 48K I"m retro fitting with Raspberry Pi

Goal is to not break the original board (much) and write a USB HID Linux driver for the original rubber membrane keyboard and fit HDMI out ext without anything dangling out the EDGE connector if physically possible.

Questions, what do we know about the ZX keyboard -> UART/USB, or is my only real option to take a generic USB HID keyboard and mechanical retro fit tot the micro switches?

Also Kempston mouse, anyone know about that? (and does anyone have one) I guess could use Sinclair joystick (which maps the the keyboard) and create onscreen cursor with Qt for example...

Kev
Posts: 2
Joined: Tue Feb 14, 2012 7:36 pm
by Paul Webster » Tue Feb 14, 2012 9:35 pm
It pre-dates USB and looks to be relatively tricky to do.
This old write-up should help
http://www.users.globalnet.co......r01_58.htm
User avatar
Posts: 412
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by plugwash » Tue Feb 14, 2012 10:25 pm
I don't have specific experience of the specturum but tt should be possible to program a USB PIC to scan pretty much any keyboard matrix and convert the results into PC keyboard scancodes for feeding to a PC.
Forum Moderator
Forum Moderator
Posts: 2266
Joined: Wed Dec 28, 2011 11:45 pm
by Lynbarn » Tue Feb 14, 2012 10:54 pm
kevleyski said:


I have an old ZX Spectrum 48K I"m retro fitting with Raspberry Pi

Goal is to not break the original board (much) and write a USB HID Linux driver for the original rubber membrane keyboard and fit HDMI out ext without anything dangling out the EDGE connector if physically possible.

Questions, what do we know about the ZX keyboard -> UART/USB, or is my only real option to take a generic USB HID keyboard and mechanical retro fit tot the micro switches?

Also Kempston mouse, anyone know about that? (and does anyone have one) I guess could use Sinclair joystick (which maps the the keyboard) and create onscreen cursor with Qt for example…

Kev


I'm not quite sure WHY you would want to do this (the first peripheral I got for my speccy was a metal-cased proper keyboard) but APEM and similar manufacturers will probably be able to manufacture a suitable membrane keyboard, although at what cost I do not know!

If you could be a bit more flexible (excuse pun) then maybe something like one of these on eBay would fit the bill (and with a bit of trimming, perhaps even the Spectrum case?)
Posts: 464
Joined: Wed Jan 04, 2012 11:03 pm
by bigand » Wed Feb 15, 2012 8:41 am
If you have a look here:

http://www.flickr.com/photos/z.....543421081/

This guy has got the original working through a hacked usb keyboard.

Edit: I think it might be one of those listed in the ebay link above.
Posts: 4
Joined: Tue Jan 10, 2012 8:48 am
by mccp » Wed Feb 15, 2012 11:06 am
bigand said:


If you have a look here:

http://www.flickr.com/photos/z.....543421081/

This guy has got the original working through a hacked usb keyboard.


Awesome!
Posts: 26
Joined: Thu Dec 01, 2011 8:53 am
by Casalor » Wed Feb 15, 2012 11:29 am
bigand said:


If you have a look here:

http://www.flickr.com/photos/z.....543421081/

This guy has got the original working through a hacked usb keyboard.

Edit: I think it might be one of those listed in the ebay link above.



It's entirely do-able.

For my initial Pi project, I've taken an old Amstrad CPC 6128 and hacked/soldered the connectors to a usb interface ripped out of a flexi keyboard (as did the Spectrum guy above). I used xev and xmodmap to create new mappings. Luckily for me the Amstrad uses a 8 x 10 array which fitted nicely.

I count this as the most difficult thing about my Pi 6128 case mod. Everything else is just gluing and cutting.
User avatar
Posts: 66
Joined: Wed Feb 15, 2012 11:14 am
Location: Nantwich, UK
by stefan72 » Thu Feb 16, 2012 10:26 am
Hello, I thougt about to add the Raspberry PI in to a working C64.

With the keyrah C64 Keyboardkonverter

it must be possible to switch between the both Computers. Actually the both can use the same TV Screen.
Posts: 2
Joined: Fri Dec 09, 2011 4:28 pm
by ady69 » Thu Mar 15, 2012 9:12 pm
Hi this might be of interest.

Its based on the beagleboard but the guy's modded his zx spec rubber keyboard.

Hope this helps.

http://www.retrothing.com/2009.....linux.html

http://www.flickr.com/photos/z.....543421081/

Second link shows the full mod.
Posts: 1
Joined: Thu Mar 15, 2012 9:01 pm
by monk3yfurr » Sun May 13, 2012 3:35 pm
If anyones interested, I've just written some code for the arduino that scans the data lines of a ZX spectrum (rubber keyboard) to determine which key has been pressed. This could then be used with an arduino duo (reflashed for HID use) to turn the keyboard into a standard USB one. Alternatively there's a library written for the PI's GPIO that should be compatible and could be used to send the keys directly to the x-window (without the need of an arduino).
Posts: 3
Joined: Sun May 13, 2012 3:23 pm
by andrewjoy » Mon May 14, 2012 1:00 pm
this may be of use to you

http://deskthority.net/workshop-f7/all- ... t2340.html

my feeling is the best way to do it would be to use the existing matrix and make your own controller

unless anyone knows what scancode set it uses then a converter could be made
Posts: 7
Joined: Mon May 14, 2012 10:55 am
by monk3yfurr » Tue May 15, 2012 3:15 pm
Thats what i'm using the arduino for, a replacement controller which makes use of the existing keyboard matrix. The original matrix is wired into the arduino and i've currently got the keys being pressed output to a hyperterminal window. Next step is to setup the arduino as a HID and we have a working usb keyboard.
Posts: 3
Joined: Sun May 13, 2012 3:23 pm
by ryandigweed » Thu Jul 12, 2012 10:51 am
I was thinking of doing the same, but was unsure how to go about this one :(
Posts: 19
Joined: Mon Jun 25, 2012 7:39 pm
by qlue » Sun Sep 09, 2012 12:44 am
Perhaps this is a silly question, but why not just use the GPIO lines?
https://github.com/cpswan/Python/blob/master/rpi-gpio-kbrd.py
edit:
Here is the post I was actually looking to link to.
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=50&t=8842
Posts: 3
Joined: Sat Aug 11, 2012 8:57 am
by andrewhannay » Thu Mar 14, 2013 4:02 pm
Just scan the keyboard using the IO pins on the RPi.
I believe the Spectrum used a keyboard matrix of 8 rows x 5 columns.
That's by far the easiest way to do it, not messing around with all that complicated USB stuff.
But, hang on, that means you need to write a driver then - oh dear, damn these complicated graphical RTOS's.
Andrew
Posts: 2
Joined: Tue Mar 27, 2012 8:07 pm