Sunday, 8 July 2012

The VC 314 Raspberry PI in a Breadbin!

submit to reddit

The VIC- 314,
 a Raspberry  Pi in a C64.

You can now read the whole text to this project here from Lotek64! issue #41! auf Deutsch

Whats a Pi?

The Raspberry Pi is a  small, inexpensive computer that is capable of running tasks like most other PCs, however it is smaller, a lot smaller in fact it measures  85.60mm x 53.98mm x 17mm , almost the size of a credit card and costs £25. It has an ARM11 chip at its heart, which finds its origins in early UK microcomputers, notably first in the Acorn Electron, the brain child of  Mk14, ZX80 and 81s’ Chris Currie and Austrian physicist Herman Hauser.
It is made by a foundation that is run as a charity, amongst the PI’s aims is to bring raw coding and computing back to the young masses who are  suffering with a lack of computer skills, there is a generation that can use computers , but not a generation that can make computers work without pointing and clicking a mouse, there is a difference between the two, the same analogy  could be applied to technicians and Engineers, the Techs can swap and change, but the Engineers can fix and fabricate and innovate, it is said that the fear is we have more Techs than engineers. So bringing a cheap raw computer to the masses is one possible way to reverse this trend. Similarly  the way the first computer to retail less than £100 the ZX81 kick started  the early inception of creative computing, the results are still with us today.
As to how easy or hard it is to use, I am not sure, the RPi will be debated by more and more of its energised following as they receive their computers, time will tell, maybe I can write about that one day.

Getting the concept.

I read and saw on the internet a system called mini ITX, which is a system that could slip into an existing computer case, like a ZX Spectrum and emulate the system that it was fixed into, provided you could install the emulator, however it is expensive and I did not really understand how to go about it.

So at 0630 on the 29th of February this year I placed my order, not with the purpose of learning to code, but to obtain this computer as an alternative to the mini ITX.

Two years previous to this I had acquired a Commodore 64 that had been in a wet storage container for many years, not a lot happened on powering it up, and when opened I discovered the PCB to be rotten with damp damage, so I stripped it back to its case and keyboard, I discovered a great USB keyboard adapter that retro-fitted straight into the C64, the Keyrah by Siliconsonic. It only took five minutes to turn my moribund keyboard into the most interesting PS2 keyboard for my PC that I have ever used.
I also used it to run the Frodo emulator on my Nintendo Wii, so with this in mind I knew installing a PI in my case was possible and maybe easy too.

In mid- May I was Lucky enough to receive my Raspberry Pi, it was from a second batch, they had sold very quickly on the order day, some people have been advised September delivery.
It comes ready built, it has an SD card slot, 2.5mm Audio out, RCA Video out, piggy backed [ double ] usb socket, Ethernet port, HDMI socket and a power socket shaped to micro USB spec.

You need to supply a 4GB SD card and burn an image or the firmware to get the PI to boot up, this was available from the Raspberry Pi web site, you also need you own power supply ( a Samsung Phone Charger in my case)

First impressions were, ‘I am going to Break this!’  with all the wires plugged into their ports the PBC was skidding all over the table, there are no screw holes or mounts, you have to improvise something yourself to be sure of protecting it, I did so temporally with some Lego. There was no doubt now that I wanted to get on and start on the VIC 314.

Shopping List.

Keyrah USB interface ---- from the most excellent
USB ext Cable male / female
4 way usb port
Triple RCA female / female plug
1M Ethernet cable Male / Female
HDMI 2M cable Male / Female
ON / OFF single pole switch
2.5mm Barrel socket
2.5mm barrel pulg
2.5mm stereo Jack to 2 x RCA plug lead
RCA lead male / male
Epoxy Resin adhesive
100 ml Plastikote Enamel Paint ( aerosol )
Soldering equipment and plenty of masking tape, for the Paint and for clamping.
General tools, pliers, knife and the like.

Getting started.

The problem I thought about first was regarding the Keyrah, its USB 2.0 port to PC socket was facing the outside of the case, were it all to be enclosed the plug would have to face inward, I was prepared to re-solder the socket, however no need! The Keyrah has pinouts on its PCB so all I had to do was slice a USB lead and solder the wires to the board, although I managed to find a socket that slid over the pins, which made for a tidier job.

 keyrah with usb cable over the pins.

The USB socket port.

I had been looking out for a USB splitter as I knew that one socket on the Pi would be used up for the Keyrah Connection so I needed one extra as a bare minimum for the mouse, I was very lucky to pick up a four way adapter whilst grocery shopping, It was perfect and when glued into the case it fitted over the user port nicely, I had to cut one screw bosses from the case to level the sockets off, I did this with a craft knife with ease.

Keyrah and PI connected to USB hub

A word about the Epoxy resin Glue: It is the best adhesive to use, however it appears to do nothing for a long time, the instructions said that it would be only workable for five minutes, however you have to in reality tape or clamp down the objects for hours and leave well alone. A good tip was to do a socket a Day, also before touching the socket to check on its progress, touch the left over resin that you mixed, if this is still soft then leave the Case alone! It takes 12-24 hours for it to be rock hard, but it is well worth it.

Audio/ Video connections and the Power supply.

Next was the Audio and Video leads, I had to in fact needed to shorten the leads as I anticipated how tangled it could get under the keyboard on completion, so I cut and re spliced them to achieve this.
The Triple Phono joiner was next to be glued, this fitted perfectly in the Cassette port.
The power supply has to be rated at 5 Volts with 700 – 1200 mA current, however mine is slightly smaller than this 4.75V but when tested under a meter it gives 5.01 V, go figure! . One of the most annoying things for me was the method of turning it on and off, basically pulling the plug out, if this is done repeatedly I am sure that it could loosen from the PCB and there is the added risk of placing your thumb and finger on the capacitor nearby, I have read of people accidently pushing this off, so a simple switch was a must for the VIC.
I cut the wire to the PSU and established the White wire  was positive, so I soldered this wire to the centre barrel connection, this way if I were to push or pull the power supply barrel the negative would always make contact with the board first  ,this could  minimise the risk of blowing diodes on the PCB. A tip on soldering the barrel socket is to solder the wire with the plug inserted, because the insulation gets hot and melts and this moves the centre pin out of position, leaving the plug in will eliminate this problem.

 The Socket and switch affixed to the case.

This left the end with to the Mains plug quite a bit shorter so I extended the wire so I could use it comfortably in the future.

The power socket and the switch were selected to fit the H-L and RF slots without the need to cut or drill the case. I used hot glue to seal off the soldered connections. It was a nice feeling to turn the Raspberry Pi on without using the fiddly plug, it was beginning to feel like a real computer at last!

HDMI and Ethernet.

The HDMI and the Ethernet sockets were next, these were glued in the same way as the other ports, the Ethernet cable was purchased from eBay, it was the only one my search broughtup, if I could not source this type of cable I would have had a cable made and added a Female/Female connector and left the end open to act as the socket.
The Level of the sockets were padded from underneath with Lego tiles! They were perfect for this, when I glued them however it was best to stick them upside down other wise air pockets got under the tile and that would not create a very good bond, likewise the up side would then fill with resin creating a really good surface for the cables to mount on to.
The HDMI lead was longer than I hoped, a 1 metre length would have been easier to coil and take up less room, I also had to clamp the HDMI lead down well as the weight of it was moving it out of position to easily.

 Taping down the annoying HDMI lead.

All of the leads were now installed, the only slot left was the expansion gap, the Keyrah was behind this one so I glued a piece of trunking to cover over it, this obscures the slot and tidies it up at the back.

Closing it up.

The final thing to do was to very carefully coil and route the cables so they would not squash the Keyrah and the Pi, as a bonus, the PCB of the Pi did not need mounting as the wires plugged into it in all directions suspend it under the case.

just before closing it

The Model Name.

In my research the C64 was either codenamed the (VC) VIC 40 or 50 and there was a (VC) VIC 10 and VIC 20 obviously, so I call this the VIC 314 it is simply PI with the decimal point removed, but you guessed this already!

Various angles

A quick word about the Paint job,

My first idea was to give this the Livery of the Raspberry Pi : Purple, Black and Grey – however I could not obtain the right colours in a hard wearing paint, plus this is a Commodore computer and I did not want to be overtly sycophantic to the Raspberry Pi, yes it’s a Pi but I did the Project because this C64 was the computer that deserved to live longer than it should have…. It had died once in the storage container where it was first found, and now it lives again.

Road testing.

Operationally it works perfectly, I have installed Vice and can play games using the Joystick and the sound driver is now working,perfectly.

Getting VICE to work and sorting the full screen for Playing. 

I have never used the sudo commands in cmd line until I started using Ubuntu on one of my PCs, so I looked with some trepidation at installing VICE, however this was very easy an I would recommend you visit the eLinux site to get step by step instructions on how to do this.

When I got the emulator running the screen in full screen mode was of the bottom right hand corner, this was because the overscan settings for the Debian squeeze OS were different, so I asked on the Raspberry PI forum and got simple step by step instructions on setting up a separate boot for VICE from a helpfull member of the community, I simply run the PI and then initiate the new overscan code, restart and it changes overscan on re-start allowing me to use the screen perfectly in full screen ( a little off the left and right border but fine ) when I quit the system it will restart in normal PI overscan allowing me to use the VIC to surf the net and  the like. When it runs, the sound buffer overruns and silences the emulator, how ever when you stop moving the mouse about and the CPU slows down, you can re-enable the sound and it plays very well indeed.
You can define the joysticks in the keyset menu to get joystick operation working.

Missing keys?

So what if we need to use the keys that are not on the VIC? well I have plugged in another keyboard via the USB 4 way port and this works well, conversely If I wanted the VIC to be used as a keyboard to a PC, this still can be achieved with use a usb lead, providing the PI section is not powered up this will work as normal.

Total Cost

Raspberry Pi £25 *excluding Carriage ,Keyrah USB interface £24.80  excluding carriage
Total including Cables and materials excluding the C64 Case were about £65 but the equipment was purchased over time so no impact was felt to me financially.
I would estimate that the project took about 15 hours to finish but I was not really keeping track, staring at it in admiration was probably a big chunk of that time.
The VIC 314 running.

Final Thoughts.

Personally, I am very pleased with the results, if any of you find a dead computer I hope you can make it a great machine again with some imagination. I would think that it is an easy project to take on if you have some experience of having to fix things or retro fitting parts to existing builds in the past. If you have any questions or want to share your efforts with our community then please do.

Thanks for reading.


  1. Hi,

    That looks awesome!! :) Very impressive work! I'll definitely check it out further. Seems like the Raspberry Pi is useful for so many different things. Quite the versatile piece of hardware!

  2. This is awesome...thanks for resurrecting some retro-goodness. That theme song brought some old memories but I can't for the life of me remember what it's from! AND Bruce Lee!!!!??? Awesome...many very fond memories of that game.

  3. I'm glad someone did this! I just got my two RasPi's last month and was looking to stick one in one of my C64's or even an SX64 but since they all work I thought twice about it.

  4. thanks for your comment, some people think I have just butchered a working machine, I would not recommend that, even the most powerful emulators do not do a real C64 justice.

    look after those Machines! ;)

  5. Any chance of a howto for vice? I'm trying to do something similar, but having some probs software wise.

  6. Hi, have you tried going here.....

    its very straight forward, I am a newbie to Linux o/s and managed it easily.

    good luck.

  7. also if you need help installing VICE, check this thread out.....

  8. Awesome...I retro fitted a human being (myself) for my Halloween costume. MR ARCADE HALLOWEEN COSTUME 2012 , check it out on youtube. It can play Vice but it's actually running MAME off a windows laptop. I intend to use a Rasberry Pi next time for extra battery life and weight reduction.

    Slightly off topic, I know, but check it out - It's Awesome!!

  9. Love this. I added it to my "10 coolest Pi projects" list. I hope you don't mind.

  10. thanks camilian, that no problem, I will be sure to add your blog to my links.

    looks like a cool blog too.

  11. What configuration values in keyboard configuration file (/etc/default/keyboard)? This may fix missing keys problem.

  12. This comment has been removed by a blog administrator.

  13. Is the ChameleonPi compatible or support the Adafruit PiTFT 2.8 display adapter?
    It has 320x240px resolution only, but I think it's very usefull in this case. :)

  14. Hi Sancho, I would not know if these would be compatible, some good people to asy are a company based in Germany,
    if you could reply with your findings, that would be great.

    Thanks for reading.

    1. Unfortunately, they will not be able to say this because they don't develop the operating system as ChameleonPi. However, be sure that there will be problems in operating the smaller display because most simulators is only set up to full HD resolution. As soon as I can have the lower resolution is, unfortunately, not many start emulator program.