Friday 6 January 2012

Commodore 64 Reset Switch using the keyboard

Another mod for the C64 had been nagging at me ever since I started using an XE1541 cable to load software. I needed a reset switch to stop having to keep physically turning off the computer when trying new games and such. I ordered some small switches from eBay but spent the evening pondering whether  it would be possible to expand on my idea of using the keyboard for the reset? After some thought I came to the conclusion that if I was to go ahead with this idea it had to be bomb proof and not able to be done by accident.

My idea was to use a three key combination CONTROL - Right SHIFT - RESTORE similar to the old PC keyboard reboot.  Each of these keys is large enough to take a second pad underneath like I did with the Left SHIFT key for the Bluetooth mod. I have used the reset link from the USER PORT(line 3) and wired that in series to a switch on the CONTROL key, the RESTORE key and finally the Right SHIFT key. This is then in turn wired to Ground , so that when and only when all three keys are held down does the C64 do a RESET. Thus far it seems to be working well and from the outside you absolutely cannot tell anything is different from a stock C64.




Here you can clearly see the wire running around the keyboard fixed in place with some hot glue, unfortunately I had ran out of clear melt glue and had to use the horrible brown stuff. You need to be very careful here, too much glue, and you won't be able to close the cover properly as it sits quite snugly on top of the keyboard when the case is re closed.

The reset is working as it should do, even when using the MSSIAH cartridge. It's not something I am going to use all the time, but is a handy tool should I need to use it.

Monday 2 January 2012

Commodore 64 VGA, Bluetooth Audio and NanoSwinSID Mods

Been a busy few weeks since my Monotribe Mod.  Finally got around to taking apart my Commodore 64 I planned on using in the studio for chip music.  It's been a long road with the C64, I'm on my third as the first two had faulty SID chips plus other faults. I had been looking into PIC chips for various home brew projects and I came across the Nano SwinSID. The website is quite large and full of great stuff for your C64 including a replacement for the flakey PLA chip.  At only 12 euros each the SwinSID's are great value when you conscider buying a real SID is going to cost anything from around £25 on eBay plus postage, then there is no guarantee it will work for very long as often they have been pulled from another dead machine then tested. I ordered two and it was while waiting for them to arrive I toyed with the idea of using one of them in the SID2SID board I had laying around since the purchase of the MSSIAH cartridge over a year ago.


I almost always buy two of everything just in case either I need one for another project or I break something. They really are a work of art and are pretty much a drop in replacement for a real SID. They don't however read the POT X/Y inputs so although they will work with joysticks, they won't work with a real 1351 mouse or equivalent adapter. My idea was to use one of these as a second SID and use the original 8580 as SID1 so that I could use a mouse or paddle controllers. For those interested in the whole SwinSID project click the link and have a read, it's fascinating stuff.

Building the SID2SID board only took a short while and everything worked as planned without a hitch, a first for me! My next idea was how to get audio from this board to headphones. Now a lot of people have added phono sockets or similar to their C64,  I wanted to do something different and also hopefully protect my SID chip from any risk of dying from plugging/unplugging problems while say a mixer unit is still on.

I found on eBay some cheap Bluetooth Audio Transmitters, the sort that will plug into your portable CD or MP3 player and enable you to use Bluetooth headphones with them.  At around £12 each they seemed a bargain.  Luckily for me stuff like this charges from USB which is around 5 volts and the C64 has 5 volts as part of it's power supply.  

It took a while going through spare parts to find all the bits of wire and a suitable socket adapter for the BT Audio dongle.  I wanted to make the installation as easy as possible without having to solder directly to a tiny surface mount mainboard. I chose to use some velcro to attach it on top of the cartridge port, this should act not only as a good safe place for it, but act also as a reflector/shield and hopefully stop any interference with the mainboard of the C64. 



Looking at the photo you can see I've used the original 3.5mm headphone adapter and micro USB cable.  The audio is split Right and Left with the mono outputs from each SID chip, I was concerned that the output from the NanoSwinSID would not match the original SID but removing the top link solved that problem. Power is taken directly from the Power switch as I found taking power from elsewhere on the mainboard was causing problems. Bottom left is the SID2SID board with the original and NanoSwinSID chips installed. The very bright blue LED on the Bluetooth adapter looks quite funky through the grill on my C64C case.  But what are those wires coming out the bottom of the Bluetooth adapter? This was my next idea, to have a secret switch installed to the keyboard of the C64.

In order for the Bluetooth to work it has to be paired with either some headphones or a lineout device to plug into a mixing desk. On most devices like mobile phones or your PC you normally have to enter a four digit code. This dongle does away with that and pairs itself automatically to almost anything. However having to keep removing the top case was getting tiresome and I wanted a better solution.

In order to pair or turn the dongle on off you had to hold the top switch for sometime which I decided would be ideal for hacking. I popped open the case and found that not only was everything very very small and surface mounted but the switch was quite accessible and could be soldered to easily. I soldered two tiny wires to the switch inside the Bluetooth adapter and tried touching the wires to see if it would work. It worked a treat and now all I needed to do was workout what kind of switch to use.

I decided to be clever and hide the switch inside the left SHIFT key on the C64 keyboard. I scrounged some bits of an old arcade controller for a tiny keypad and set about making the hidden switch. Now you can't really wire anything to the actual keyboard as it's either going to confuse the SID chip or break it entirely. My solution, have my switch along side the SHIFT key. Hopefully the following photographs make sense of what I have written.

Although you cannot tell from the photo, I had to file around the SHIFT key to make it shallower, taking into account the height difference of the new contact switch I had made. The contact pad is the type used for computer keyboards  and the two wires are wired to the switch on the Bluetooth adapter.  To keep things in place I pumped hot glue inside the Bluetooth adapter as the tiny wires were really quite delicate and soldered to tiny tiny parts of a surface mounted switch. I used more hot glue under the keyboard to hold the wires neatly.
This setup works really well, you just hold the left shift key down to turn on Bluetooth or pair it with a new device. From the outside you really cannot tell it's even there, except from the funky flashing blue light under the case.

My next mod seemed a little creative if somewhat ambitious. I had been using a composite video display, an old Microvitec CUB and to be honest it's not well at all. I could have just used a standard LCD TV but a lot of them are quite fussy and will not see/lock onto a vintage composite video signal. I already have a SVGA monitor and wanted to use that.  I have been using an upscaler with some other games consoles and found you could buy quite cheaply really small ones the size of a matchbox for around £15 delivered on eBay. These are also using a 5 volt supply. I did some testing with a multimeter and found that the main supply had enough to take the load of one of these as well as the Bluetooth adapter and C64 without killing the PSU hopefully. Time will tell, as my power supply is quite old now and I may have to make a new one.

I decided to mount the VGA port on the left of the rear of the case away from everything else, hopefully to reduce electrical interference and noise from other components. I took time cutting a neat slot using some hobby files. It's always worth the effort to take a little bit longer as the end results always look better. My only immediate issue was that the S-Video input socket was right next to the VGA output. This would mean soldering directly to the tiny board of the VGA upscaler. Lots of checking with a multi meter here and powering up for the first time on the supplied PSU I was greeted with a much improved display over the blurred Composite video signal. I decided to do a couple of extra modifications here using some resistors to reduce the Colour and Luminance signals to the VGA adapter. This has two effects, one by reducing the Colour signal with around 300ohms you stop the screen from strobing and bleeding, two by adding around 200ohms to the Luminance signal the horrid vertical lines are much reduced.  

A good place to find out about video modifications etc is HERE, I just adapted the installation for my own means. As you can see there is easy access to the GUI buttons for setting up the VGA upscaler. Once set it cleverly remembers your settings so that every time you switch on your C64 you wouldn't know it was there. Except you now have a VGA output.  This has the added advantage the original Video socket is untouched so should I ever need a Composite signal it's readily available. Hot glue was used to attach to the case and has the added benefit of actually giving some support. I omitted using the VGA screw in holes as I thought they looked a little ugly and would have meant making a huge hole, risking cracking the quite flimsy original case.


As you can see, with the case closed the VGA socket looks almost like it's supposed to be there, video output is really crisp and gives a much improved and very usable display in a home studio.

I haven't finished yet as I want to add an SD card reader to the C64.  Not sure where exactly I am going to install it yet as I really want to keep the case looking as neat and original as possible.