The ElectronPi

Arc/RPCs, peripherals, RISCOS operating system & ARM kit eg GP2x, BeagleBoard
Post Reply
User avatar
flaxcottage
Posts: 3111
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

The ElectronPi

Post by flaxcottage » Sun Sep 11, 2016 1:51 pm

The ElectronPi

A few years ago I bought an Electron which was in a very sorry state. There was no PSU, the keyboard was defaced, the loudspeaker was broken and most of the keys did not work. It was my intent to keep it to provide spares for my other Electrons.

Last year, however, I read on various forums that people were looking to fit a Raspberry Pi into an Electron case. Most of these were using Raspbian. I wanted to use RISCOS to make such a machine closer to the original and when RISCOS-pico was produced I had a suitable operating system for the Pi. The problem was connecting the Electron keyboard to the Pi in an easy manner.

The idea went to the back burner for a while. I thought I should have to source a suitably sized USB keyboard to fit into the Electron case but to date I have not found one.

Last month I came across the Tynemouth Software web site (http://www.tynemouthsoftware.co.uk). Dave Curran, the owner, has produced an interface board that can be linked to a whole range of retro-computer keyboards. The boards have suitable connectors to fit the respective micro's keyboard leads. One of these boards was shown in his blog fitted into an Electron case, turning it into a USB keyboard that could work with any computer. He even advertised an Electron fitted with a Pi model A and USB hub on eBay but this was running Raspbian.

I contacted Tynemouth Software and bought an Electron keyboard interface shown here;
Electron keyboard interface.jpg


This is really neat. There is even an Electron beep sound when it powers up. On testing, though, it was found that the USB mapping was not right for RISCOS-pico, since it was set up to work with a PC and Windows.

And this is where Tynemouth Software's customer service proved to be outstanding. I discussed the problem of working with RISCOS-pico with Dave and we worked out the USB mappings for the Electron keyboard; it is a unique keyboard having multi-function keys. I returned the interface board and it was re-programmed to suit and worked almost perfectly with the Pi. I say 'almost perfectly' because there are some idiosyncrasies between the keyboard and RISCOS pico that make its use quirky. But I like quirky!!

The first stage in making my ElectonPi was to strip everything from the case. and assemble the components ready to fit.
IMAG0467.jpg
I modified the case slightly. Originally it was the idea to fit an HDMI socket on the back of the case by a flying lead, which explains a vacant cutout in some of the pictures. I bought a StarTech lead from Amazon but, unfortunately, this would not pass through the HDMI signal to make my HDMI-VGA convertor work. It may work correctly if just extending HDMI to HDMI, however.


The partition between the PSU section and the motherboard area had two more deep grooves cut into it to allow USB cables to loop round and a cutout for the Pi HDMI socket was made at the back of the case just above the Electron expansion outlet.
IMAG0470.jpg
The USB socket for memory sticks was fitted to a piece of black plastic cut so that it would cover the various socket holes at the left hand side of the case. I fitted the USB panel connector to use the Electron video hole.
IMAG0471.jpg
Hot-melt glue was used to fit the USB panel and to hold the Pi in place. The plastic supports came from a project box I used ages ago and they hold the Pi securely in place. I also glued the HDMI socket to the rear and used the Ethernet socket as an anchor too. There is just enough space to remove and insert the SD card.

This build uses a retro-Pi, one of the first to be produced. It only has 256Mb of RAM but that is plenty for this application. The SD card is only 1Gb too.

The next stage was to fit the keyboard interface on its plastic self-adhesive legs. I only used 3 to allow room for the USB plugs. Space is amazingly tight.
IMAG0472.jpg


Once these three components were in place the USB wires were connected and tied down.
IMAG0473.jpg
The reason for the cuts in the power supply partition can now be seen. If a shorter A-B USB cable were to be used then the construction may be neater. Anyway everything fits and the keyboard just drops into place.

Next I modified the PSU board slightly, removing the flying leads (keeping them safe to put back if needed in the future). I cut a micro-USB lead and separated the power wires (black and red in my case) and soldered them direct to the PSU board in the appropriate holes. The cut end of the USB cable was tidied by a length of heat-shrink tubing.
IMAG0474.jpg
The keyboard was attached to the interface board and the machine was complete.

In place of the 19v AC PSU that came with the Electron I used a spare laptop PSU that output 19v DC at 3.9A - plenty big enough!! The Electron PSU provided 5.01 volts on load, which is pretty good for the Pi.

Switching on, beeping and seconds later the screen showed the Pi had booted correctly.
IMAG0477.jpg
So now I have what looks like an Electron with 97Mb free. Mind you a real Electron never had a MODE7 display as good as this, nor did it have 256 colours in an 80 column mode.

There are some downsides to this project I found. :? When in the RISCOS editor Shift-F4 cannot be used to exit to BASIC. This is due to the Electron keyboard needing Shift-Func-4 to be pressed as there are no discrete function keys. This may be a mapping issue. To overcome this SAVE the file first and the use the *command to exit to BASIC then LOAD the program to run it. Another negative is that an extension lead is sometimes needed to read USB memory sticks. Small ones work OK but some are too wide to fit into the Electron video socket hole.

Niggles to be sure but not enough to put me off the charm of this neat little machine. :D 8)
- John

Why do I keep collecting Acorn gear? I'm going to need a considerably bigger man-cave. :?

User avatar
daveejhitchins
Posts: 4254
Joined: Wed Jun 13, 2012 5:23 pm
Location: Newton Aycliffe, County Durham
Contact:

Re: The ElectronPi

Post by daveejhitchins » Sun Sep 11, 2016 2:28 pm

Well . . . Firstly - Shame on you for destroying a repairable Electron [-X

Secondly - Brilliant =D> =D> =D> =D> =D>

Dave H =D>
Parts: UM6502CE, GAL22V10D, GAL16V8D, AS6C62256A, TC514400AZ, WD1772, R6522, TMS27C512, AT28C256
Products: ARA II, ABR, ATI, AP6, MGC, AP5 . . .
For a price list, contact me at: Retro Hardware AT dave ej hitchins DOT plus DOT com

User avatar
flibble
Posts: 644
Joined: Tue Sep 22, 2009 10:29 am
Contact:

Re: The ElectronPi

Post by flibble » Sun Sep 11, 2016 7:02 pm

Ooooh, you beat me to it :D

I have an arduino leonardo on the the way to do the electron keyboard to usb keyboard mapping.

User avatar
flaxcottage
Posts: 3111
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: The ElectronPi

Post by flaxcottage » Sun Sep 11, 2016 9:42 pm

That will be an interesting project. It should be possible to map all the Electron's foibles that way. :wink:
- John

Why do I keep collecting Acorn gear? I'm going to need a considerably bigger man-cave. :?

User avatar
flaxcottage
Posts: 3111
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: The ElectronPi

Post by flaxcottage » Fri Oct 14, 2016 12:32 pm

Since I first made this Chimera a lot of development has gone on at Tynemouth Software and they have come up with a neater version of mine. :lol:

The blog can be read here: http://blog.tynemouthsoftware.co.uk/201 ... -pico.html
- John

Why do I keep collecting Acorn gear? I'm going to need a considerably bigger man-cave. :?

User avatar
roland
Posts: 2920
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: The ElectronPi

Post by roland » Fri Oct 14, 2016 8:16 pm

This is an interesting project. If you run a normal version of RiscOS on this Electron, does the keyboard also work well?

And, is there a kind of ElectrEm for RiscOS pico so you can also run normal Electron games?
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
flaxcottage
Posts: 3111
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: The ElectronPi

Post by flaxcottage » Fri Oct 14, 2016 9:34 pm

The Keyboard works perfectly with full-fat RISCOS I am led to believe. As soon as my re-programmed interface arrives I can confirm that.

To run real Electron software one would need an Electron emulator for the Raspberry Pi. The converted system has an ARM chip inside whereas the real Electron has a 6502.
- John

Why do I keep collecting Acorn gear? I'm going to need a considerably bigger man-cave. :?

User avatar
roland
Posts: 2920
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: The ElectronPi

Post by roland » Fri Oct 14, 2016 9:38 pm

flaxcottage wrote: To run real Electron software one would need an Electron emulator for the Raspberry Pi. The converted system has an ARM chip inside whereas the real Electron has a 6502.
I am aware of that, the question was if ther is an Electron emulator for RiscOS (pico) :wink:
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
flaxcottage
Posts: 3111
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: The ElectronPi

Post by flaxcottage » Sat Oct 15, 2016 6:59 am

Ah, sorry. #-o

As far as I know there isn't. One would be great though. But then if one has a real Electron that beats an emulator. :lol:
- John

Why do I keep collecting Acorn gear? I'm going to need a considerably bigger man-cave. :?

User avatar
flaxcottage
Posts: 3111
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: The ElectronPi

Post by flaxcottage » Sat Oct 15, 2016 7:31 pm

My newly programmed Electron keyboard interface arrived today from Tynemouth Software. So my conversion is complete. It even announces its heritage on booting. 8)
PiElk.jpg
OK, for the Electron purists on the forum, I know it is not real but it is a great machine to program and it runs loads of my educational software (yes it runs Granny's Garden and the Sphinx!)

With access to a USB memory stick I can transfer SSD archives onto the machine, extract the files and run them on the ElectronPi, providing they are BASIC programs that is. I can also develop code using BBC BASIC for Windows and port it straight across via the USB socket.
- John

Why do I keep collecting Acorn gear? I'm going to need a considerably bigger man-cave. :?

User avatar
1024MAK
Posts: 7626
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: The ElectronPi

Post by 1024MAK » Sat Oct 15, 2016 7:58 pm

Yes, yes, yes, but will it show the ROM copyright message if you PEEK the hardware I/O space? :?: [see this thread].

:P

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
roland
Posts: 2920
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: The ElectronPi

Post by roland » Sat Oct 15, 2016 8:44 pm

John,

I really like it =D> and I'm considering to reproduce it =P~
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
flaxcottage
Posts: 3111
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: The ElectronPi

Post by flaxcottage » Sat Oct 15, 2016 10:34 pm

1024MAK wrote:Yes, yes, yes, but will it show the ROM copyright message if you PEEK the hardware I/O space? :?: [see this thread].

:P

Mark
No, sorry. I wrote a program to show that message. It is still a Raspberry Pi inside. I like trying to get retro CAL software running on it. It is quite a challenge sometimes. The case makes it much Better!
- John

Why do I keep collecting Acorn gear? I'm going to need a considerably bigger man-cave. :?

User avatar
1024MAK
Posts: 7626
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: The ElectronPi

Post by 1024MAK » Sat Oct 15, 2016 10:47 pm

flaxcottage wrote:
1024MAK wrote:Yes, yes, yes, but will it show the ROM copyright message if you PEEK the hardware I/O space? :?: [see this thread].

:P

Mark
No, sorry. I wrote a program to show that message. It is still a Raspberry Pi inside.
It's alright John, I was only joking...

A member on a forum (I forget now which one) posted about the keyboard interfaces from Tynemouth Software (http://www.tynemouthsoftware.co.uk) and the work done by Dave Curran some time ago. Don't have any myself (no spare useable cases), but I respect his work.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
flaxcottage
Posts: 3111
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: The ElectronPi

Post by flaxcottage » Sun Oct 16, 2016 9:36 am

I couldn't agree more about Tynemouth Software. :D

Dave is a very busy guy (which is a good thing if you are in business) but still managed to turn around the programming and the interface within 24 hours. He far exceeded my original brief and went on to add almost perfect Electron keyboard functionality. =D> =D> =D>

The problem with the Electron turned out to be the use of the Function/Caps Lock key. The original idea was to use Shift-Func as a CapsLock key. This did not work out too well. The CapsLock would not toggle and Shift-Func-4 would not work, for example. This made RISCOS tricky to use. After a series of emails, Dave worked out a perfect solution. I guess he got hooked by RISCOS pico and the Electron, as did I when I first put them together.

The interface now uses Func-Escape for the CapsLock and that works reliably. Shift-Func-4 works as expected. All the Electron short cuts are working, so pressing Func-R runs the BASIC program under development, for example. That is something I don't really use but it is very cool!

To get F10, F11 and F12, Dave programmed Func-0, Func-[=/-] and Func-Break respectively.

This has been an amazing project and makes using a retro Raspberry Pi (original 256M, 700MHz, model B) a really enjoyable experience. And the beauty of it all is that if I get bored of RISCOS pico I can swap the SD card for full-fat RISCOS or any of the OS that run on the Pi. There is room in the case for a Pi version 3, which would give a wireless-capable machine... :shock:
- John

Why do I keep collecting Acorn gear? I'm going to need a considerably bigger man-cave. :?

User avatar
flibble
Posts: 644
Joined: Tue Sep 22, 2009 10:29 am
Contact:

Re: The ElectronPi

Post by flibble » Tue Oct 18, 2016 6:18 pm

I thought I'd post a little update, I've had quite a lot of success with using an Arduiono Leonardo to do the the conversion from electron matrix to USB. I took it to my local Raspberry Jam on Sunday and it survived being poked and prodded by the public. Many games of Arcadians were played :)

I hope to do a full write up and publish the Arduino code soon, but RISC OS show prep is taking a lot of time at the moment. I managed to get a really complete keyboard functionality set working, included the basic keywords on FUNC+Key. There is one major issue though, no RISC OS support, this isn't on me though, it's on RISC OS not handling composite USB devices properly :(

Here's a link to a couple of picture that were taken on Sunday.

https://twitter.com/EghamJam/status/787719033713987584

User avatar
roland
Posts: 2920
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: The ElectronPi

Post by roland » Tue Oct 18, 2016 6:29 pm

flibble wrote:There is one major issue though, no RISC OS support, this isn't on me though, it's on RISC OS not handling composite USB devices properly
I don't get it .... Flaxcottage has RiscOS Pico running with USB. Is there a difference between the two RiscOS versions in handling USB devices?
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
flibble
Posts: 644
Joined: Tue Sep 22, 2009 10:29 am
Contact:

Re: The ElectronPi

Post by flibble » Tue Oct 18, 2016 8:29 pm

roland wrote:I don't get it .... Flaxcottage has RiscOS Pico running with USB. Is there a difference between the two RiscOS versions in handling USB devices?
We use different USB devices for converting the Electron key matrix to a USB keyboard.

Flaxcottage uses the Tynemouth Software board, costing 42 quid,
I use an Arduino Leonardo (clone) microcontroller board costing about 5 quid :)

User avatar
roland
Posts: 2920
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: The ElectronPi

Post by roland » Tue Oct 18, 2016 8:54 pm

OK, so IMHO it's not RiscOS that has problems with USB devices but the USB keyboard implementations are different. Is that right?
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
flibble
Posts: 644
Joined: Tue Sep 22, 2009 10:29 am
Contact:

Re: The ElectronPi

Post by flibble » Tue Oct 18, 2016 9:02 pm

roland wrote:OK, so IMHO it's not RiscOS that has problems with USB devices but the USB keyboard implementations are different. Is that right?
Yeah, RISC OS has a problem with *some* USB devices, including the one on the arduino, where it's what's known as a composite device (multiple different devices combined into one interface), which in the a case of Arduino, is a device for programming it, a serial port device for serial monitor *and* the keyboard device.

Post Reply