bennya
Posts: 14
Joined: Tue Apr 23, 2013 9:19 am

Frankenspectrum!

Tue Apr 23, 2013 8:56 pm

Hey all,

This came up in the Other Languages section, but might be more appropriate here.

Inspired by the guy on Flickr who married a Beagleboard to a ZX spectrum case, I present the Frankenspectrum :)

Looks like a standard rubber key Spectrum...

Image

Two speaker cutouts...

Image

SD card slot on the side - another hint of something custom

Image

New ports on the back of the Spectrum. Left to right - power (and a button linked to the keyboard matrix), usb ports, 9 pin Atari compatible port, composite out, reset button and status LED, HDMI output, and Ethernet port.

Image

New internals. Internal 4 port hub, 2 ports containing Wireless/Bluetooth dongles, other 2 taken out to the existing expansion ports.
To the right of the hub, a small amplifier board which takes the audio from the Pi, gives it a boost and is connected to the existing speaker location on the right, which is mirrored on the left for stereo (this is activated only when Composite input is active - audio's through the TV when HDMI is connected).
SD card socket is extended out to the right hand edge - this was half forced when I broke the existing slot :)
Stripboard in the middle is for power distribution, I use a 1.5A supply to feed the hub, amp and Pi with power.
The Pi itself has had the composite and audio sockets removed, SD card slot removed and extended, and the GPIO headers replaced with right angle pins to fit the case.

Image

Top keyboard half - USB keyboard controller hooked up to the original membrane

Image

Powered up. System voltage and TP1/TP2 voltage displayed on the seven segment displays left to right

Image

Boot splash screen

Image

Welcome screen (auto login is configured)

Image

Running FUSE

Image

FUSE's options menu

Image

Running Auf Wiedersehen Monty

Image

Running Comic Bakery under C64 emulation

Image

XBMC home screen

Image

Streaming some video

Image

LXDE desktop

Image

Any questions, fire ahead!

Thanks,
B

Holliss
Posts: 16
Joined: Fri Apr 19, 2013 12:33 pm
Location: London

Re: Frankenspectrum!

Wed Apr 24, 2013 8:12 am

Excellent work and great stuff to those of us old enough to remember the Spectrum very fondly ie me.

dan3008
Posts: 1171
Joined: Wed Aug 15, 2012 1:05 pm

Re: Frankenspectrum!

Wed Apr 24, 2013 2:12 pm

wow :D I love it. I remember the old ZX spectrum. I finally said goodbye to mine about 6 weeks before the pi was first announced. It gave up the ghost 3 years ago, but i'd had it in pices trying to fix it. Wish i'd kept it now lol

Slightly off topic, but how did you get the welcome splash working? I've been trying to get one working on my pi, and i've ended up writing one in python to display the image and using the xinit command lol
dan3008 wrote:Pays your money, takes your choice

bennya
Posts: 14
Joined: Tue Apr 23, 2013 9:19 am

Re: Frankenspectrum!

Wed Apr 24, 2013 2:34 pm

Hi dan3008,

I used the method documented here: http://www.edv-huber.com/index.php/prob ... i-raspbian

You still get the first 4 lines (up to 'Waiting for /dev to be populated') on the console when booting, but everything else gets hidden.

I've since modified the asplashscreen script to detect if the space key is pressed and if so, show the raw console output on startup. Bit like a junior safe mode!

B

User avatar
mikerr
Posts: 2489
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Frankenspectrum!

Wed Apr 24, 2013 2:45 pm

I see you have a quickshot 2 in the background - best joystick ever !
Android app - Raspi Card Imager - download and image SD cards - No PC required !

bennya
Posts: 14
Joined: Tue Apr 23, 2013 9:19 am

Re: Frankenspectrum!

Wed Apr 24, 2013 2:48 pm

mikerr wrote:I see you have a quickshot 2 in the background - best joystick ever !
Yep - hard to beat the clicking of microswitches for authenticity :)

dan3008
Posts: 1171
Joined: Wed Aug 15, 2012 1:05 pm

Re: Frankenspectrum!

Wed Apr 24, 2013 5:57 pm

bennya wrote:Hi dan3008,

I used the method documented here: http://www.edv-huber.com/index.php/prob ... i-raspbian
Thankyou :) Thats really helpfull
bennya wrote: You still get the first 4 lines (up to 'Waiting for /dev to be populated') on the console when booting, but everything else gets hidden.
Yeh, I exspected that, but since i'm making a games console with a commandline user interface for picking games, it fits :)
bennya wrote: I've since modified the asplashscreen script to detect if the space key is pressed and if so, show the raw console output on startup. Bit like a junior safe mode!

B
Now i've got a basic script i can play with it, and see what i get lol

thanks again
dan3008 wrote:Pays your money, takes your choice

User avatar
chocolate
Posts: 25
Joined: Sun Jan 27, 2013 11:40 am

Re: Frankenspectrum!

Thu Apr 25, 2013 11:45 am

This looks amazing. Good job on your project.
New RISC OS user.

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: Frankenspectrum!

Thu Apr 25, 2013 4:42 pm

Beautiful. The built in voltage meters are a masterstroke! Why didn't I think of that! :mrgreen:

Average Mailman
Posts: 19
Joined: Thu Oct 11, 2012 2:23 am
Location: United States
Contact: Website

Re: Frankenspectrum!

Thu Apr 25, 2013 4:50 pm

Excellent job. Feel like I want to try and recreate something like that myself.

bennya
Posts: 14
Joined: Tue Apr 23, 2013 9:19 am

Re: Frankenspectrum!

Thu Apr 25, 2013 6:08 pm

Cheers guys :) If anyone is considering a crack at building one, don't hesitate to ask about any aspect of the hardware/software build etc.

B

bennya
Posts: 14
Joined: Tue Apr 23, 2013 9:19 am

Re: Frankenspectrum!

Fri Apr 26, 2013 2:22 pm

I've been asked elsewhere how to get the keyboard maps working, and when I was doing this originally there wasn't much explicit information on the web, so I thought I'd describe this in a little more detail.

Step 1
So as explained before, I took apart one of these for the controller board:

http://www.amazon.co.uk/gp/product/B001 ... UTF8&psc=1

The 8-way ribbon from the Spectrum mates perfectly with the 8 pin socket, however we need to customise a socket to handle the 5-way ribbon.

I obtained a 5-way socket from a broken spectrum board, and soldered flying leads to specific solder points on the USB board's 16 way socket, as follows (counting pin 1 as rightmost, pin2 as second right etc.) It's done this way to ensure each key generates a unique scancode, as some of the USB matrices are duplicated.

Pin 1 Spec > Pin 2 USB
Pin 2 Spec > Pin 4 USB
Pin 3 Spec > Pin 1 USB
Pin 4 Spec > Pin 14 USB
Pin 5 Spec > Pin 5 USB

Once this is done, plug it all together and test it. If all's gone well, hitting some keys should produce some input. It'll almost certainly be garbled though, which leads us on to..

Step 2

You'll need to produce a custom keyboard map both for the console and for your chosen X11 environment.

The process is somewhat similar, however the data formats are different.

In both cases, you'll need to find out what key codes correspond to which keys. Run 'showkey' from the console and hit each key in turn, writing down the value shown for each key. Then pop them into a loadkeys map file. (I've attached mine below, if you've done the wiring identically to mine, they should match - if not, it's just a case of matching the mappings.)

To load it, type 'sudo loadkeys <mapfile>'. This can be done via SSH in lieu of a second keyboard.

For X, the utility to generate the key symbols is called xev, and loading the mappings while starting X is done by adding the following to ~/.xsessionrc (for LXDE):

xmodmap <mapfile>

Note - I haven't been able to get symbols working under X as of yet, however upper/lower case alphanumerics, enter and space are fine. If I do get this working I'll post an update!
Attachments
Mapfiles.zip
(3.3 KiB) Downloaded 155 times

Zoandar
Posts: 52
Joined: Sat Apr 06, 2013 9:41 pm

Re: Frankenspectrum!

Sat May 04, 2013 7:28 pm

Can you please tell me where, exactly, in the file tree I would find this file?

~/.xsessionrc


What does the tilde character mean? I have tried to Find this file using Terminal (can't believe there is no search tool in the file manager!!??) and cannot find it at all.
- Zoandar -

Rpi Rev B - 512 MB with Rev 2 GertBoard
32GB SD - Debian Wheezy version 7
HDMI output to Asus VK228 widescreen display
Logitech G11 keyboard and M570 Bluetooth trackball

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 9546
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Frankenspectrum!

Sat May 04, 2013 7:56 pm

Zoandar wrote:Can you please tell me where, exactly, in the file tree I would find this file?

~/.xsessionrc


What does the tilde character mean? I have tried to Find this file using Terminal (can't believe there is no search tool in the file manager!!??) and cannot find it at all.
according to google:

Code: Select all

It's a Bash feature called "tilde expansion". It's a function of the shell, not the OS. You'll get different behavior with csh, for example.

To answer your question about where the information comes from: your home directory comes from the variable $HOME (no matter what you store there), while other user's homes are retrieved real-time using getpwent(). This function is usually controlled by NSS; so by default values are pulled out of /etc/passwd, though it can be configured to retrieve the information using any source desired, such as NIS, LDAP or an SQL database.

Tilde expansion is more than home directory lookup. Here's a summary:

~              $HOME
~fred          (freds home dir)

~+             $PWD   (same effect as ./)
~-             $OLDPWD (your previous directory)
~1             `dirs +1`
~2             `dirs +2`
~-1            `dirs -1`
dirs and ~1, ~-1, etc., are used in conjunction with pushd and popd.
So in this case its a hidden file called xsessionrc in your home directory.

Zoandar
Posts: 52
Joined: Sat Apr 06, 2013 9:41 pm

Re: Frankenspectrum!

Sat May 04, 2013 8:51 pm

Thanks! One more question. You used the character $ to preface some folder names in your examples. So what does $ mean?

I "think" I may have finally just stumbled across how to keep the display from blanking on the Pi! (Definitely no easy task for me. 2 days of searching and experimentation so far) I am testing the possible solution now, so I don't want to type anything on it until I make sure the display has stayed up for more than ten minutes. However, when I searched from Terminal for xsession I never found any files at all. Does Terminal need something done to show hidden files, just like the File Manager in X has to have that turned on?

If these settings commands work out, they would need to be automatically re-executed every time I log in. What is the easiest way to do that? Putting them in .xsessionrc? (This was suggested, so why I am trying to find the file).

Thanks!
- Zoandar -

Rpi Rev B - 512 MB with Rev 2 GertBoard
32GB SD - Debian Wheezy version 7
HDMI output to Asus VK228 widescreen display
Logitech G11 keyboard and M570 Bluetooth trackball

Zoandar
Posts: 52
Joined: Sat Apr 06, 2013 9:41 pm

Re: Frankenspectrum!

Sat May 04, 2013 9:25 pm

With showing hidden files set, I do not find any instance of .xsessionrc in the Home/Pi folder. Does this .xsessionrc file pertain to Debian Wheezy 7 on the Pi? Or would some other file take its place for me?

The display blanking prevention I found does work, so I need to find a way to execute 4 commands every time any user logs onto the Pi. The commands are:

setterm -blank 0
setterm -powerdown 0
xset s off
xset -dpms

Running those from LXTerminal does keep the display from blanking. (The first two are supposed to keep the display from blanking running the console.)
- Zoandar -

Rpi Rev B - 512 MB with Rev 2 GertBoard
32GB SD - Debian Wheezy version 7
HDMI output to Asus VK228 widescreen display
Logitech G11 keyboard and M570 Bluetooth trackball

bennya
Posts: 14
Joined: Tue Apr 23, 2013 9:19 am

Re: Frankenspectrum!

Tue May 07, 2013 4:04 pm

Apologies Zoandar, just seeing this now.

As stated above, ~ is just shorthand for the current user's home directory (in this case /home/pi).
$ basically denotes an environment variable, e.g. $HOME is typically set to /home/pi, $PATH specifies search paths etc.

Lastly, the .xsessionrc file doesn't exist by default, so it's safe to add a new one with the content I specified. This is for LXDE - different window managers may use different naming conventions.

Hope this helps!
B

Zoandar
Posts: 52
Joined: Sat Apr 06, 2013 9:41 pm

Re: Frankenspectrum!

Tue May 07, 2013 9:22 pm

Thanks!

I've got it all sorted out now, and my display no longer blanks itself, either from the console or from X.
- Zoandar -

Rpi Rev B - 512 MB with Rev 2 GertBoard
32GB SD - Debian Wheezy version 7
HDMI output to Asus VK228 widescreen display
Logitech G11 keyboard and M570 Bluetooth trackball

JimH
Posts: 2
Joined: Sun Jun 16, 2013 12:30 am

Re: Frankenspectrum!

Sun Jun 16, 2013 12:44 am

Outstanding!
I am part way though a similar build and I've just stumbled accross this thread which has given me extra inspiration.
I have the keyboard working, and I've found the same problem you did with mapping the Symbols in the GUI. I've sacrifced upper case on some letters to allow for some symbols (with CAPS shift) at the moment.
The GUI really doesn't seem to want to allow symbols generated with "Control" (mapped to symbol shift) and a letter.

Any chance I can have the first few pictures showing the inside at larger resolution? I'm still undecided on layout and it's tight, so they'd be really helpful.
I'm currently running Fuse in GTK mode in the GUI and using a mouse for the menus - how did you get around the lack of function keys to use full screen Fuse? Of course, I can map them to standard keys, but then I lose those keys...

JimH
Posts: 2
Joined: Sun Jun 16, 2013 12:30 am

Re: Frankenspectrum!

Sun Jun 16, 2013 6:04 pm

Well I slept on it, and thought it through.
There's a ton of spare input lines on the USB keyboard controller, so I'm going to add a couple of push buttons on the back of the case and map them to F1 & Escape. I've played with Fuse more and realised I don't need the other function keys, F1 brings up a menu that can access all functions (I think), and Escape will be handy to back up a level in the menu.

I also realised I can copy those picture addresses and then open in a new tab, and they're higher resolution - doh!

I'm planning on running Chameleon Pi (multi emulator with graphical interface). I've read somewhere about adding extra emulators to Chameleon, and I'm hoping I can add a Debian GUI instead. Otherwise, I can always exit to terminal first, then run the GUI.

bennya
Posts: 14
Joined: Tue Apr 23, 2013 9:19 am

Re: Frankenspectrum!

Mon Jun 17, 2013 8:59 am

Hey Jim,

Glad you're sorted for now - let me know if you need any close up shots or any other information.

Interesting info about the keyboard mappings - I must revisit this shortly.

I run the SDL version of FUSE (fuse-emulator-sdl) mode which allows use of the function keys etc. to control the menus. Edit: you'll see the extra button over the power socket, connected to the keyboard controller - this is mapped to the F1 key which initiates the menus in FUSE.

Cheers,
B

jevilon
Posts: 2
Joined: Wed Jul 31, 2013 9:15 am

Re: Frankenspectrum!

Wed Jul 31, 2013 9:17 am

I have connected the entire keyboard of the spectrum +3 to a usb . But I have a problem, in raspbian bash recognize the keyboard perfectly, but in the emulator, only recognized some keys ... Does anyone know why?

Thanks

emptybee
Posts: 23
Joined: Wed Jun 20, 2012 12:56 pm

Re: Frankenspectrum!

Mon Aug 12, 2013 9:38 am

Hi Bennya,

Very impressed with your build! Saw the same beagleboard spectrum on flickr and have been building my raspectrum using unreal speccy portable. Mine however is nowhere near as cool as yours and I particularly like your built in speakers and wifi!

In my case I need to add an Esc key as a push button and was wondering which pins you soldered yours too?

Thanks,

empty

bennya
Posts: 14
Joined: Tue Apr 23, 2013 9:19 am

Re: Frankenspectrum!

Tue Aug 27, 2013 10:24 am

@jevilon: This is because the setup of the +2A/+3 keyboards is a little weird. The extra keys present on these keyboard over and above the old 48K 40-key layout are not unique keys in their own right - they are combinations of the original keyboard layout.

For example, BREAK is really Caps Shift + Space, Delete is Caps + 0, etc.

Now on the 128K and +2 keyboards the membrane was multi layered to handle this for you, however the +2A/+3 keyboards have extra lines to carry these out as unique keys, which are interpreted by the +2A/+3 ULA.

Now, the emulator doesn't recognise these special keys as they're completely unique keys and don't map to their equivalents. I think the only way you'll get this working is to compile Fuse or your emulator of choice from source and modify the keyboard handling to recognise the extra keys.

Alternatively if you get your hands on a Grey +2 keyboard assembly, the matrix will be the old 5x8 style which gives you the correct key combinations. The black keytops can then be swapped with the grey ones.

@emptybee: Thanks! I just soldered the extra push button to unused pads on the USB controller and got a unique key first time - this is all that matters. If that key had turned out to be a duplicate, I would have desoldered and tried other pads :)

jevilon
Posts: 2
Joined: Wed Jul 31, 2013 9:15 am

Re: Frankenspectrum!

Wed Aug 28, 2013 11:36 pm

I managed to work all keys except 4 or 5, depend on the scancode to which they are redirected, missing scancodes almost always high (over 107), but not always so, is a strange thing ...

Return to “Other projects”

Who is online

Users browsing this forum: No registered users and 5 guests