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.

Sunday, 13 November 2011

Installing wireless MIDI into the Korg Monotribe

I used the following parts in building this upgrade

XRF Wireless RF Radio UART x 2  at £11.88 each
0.1uf Miniature electrolytic capacitor x 1 at 10p each
FTDI XRF USB interface x 1 at £19.50 each (it comes in a nice box)
XRF break out board x 1 at £2 each
Micro mini JST 2.0 PH 6-pin connector x 1 at 36p each

Total cost is around £46, less if you don't buy a USB programing interface in a nice box.  The connectors came with cables attached and I had to buy 10 at once. This project can be completed for what some people are asking for a single Xbee module on eBay.

What are these XRF modules? they are an amazing little device that enables us to give them serial data and they will transmit it to another module very easily. The plan? to take the serial connection on the Monotribe and plumb it into the module thereby making  a wireless serial link with our PC for sending and receiving MIDI data.

I would recommend you go ahead and install the drivers I mentioned earlier in my blog. Make sure you install the MIDIfied version of the FTDI drivers  Then I shall explain a little about how I used them and set things up on my own PC. Put one of the XRF modules into the programming board and connect to your PC.  Windows will look for a driver, again I recommend following the instructions HERE at Xbee Radios website.

Lets start by programming our modules for the MIDI baud rate etc.  Once done you won't ever need to touch them again, unless that is you want to tweak any settings like alter power output for example.


The XRF module is the small blue square plugged into the green board.  Isn't it a thing of beauty? Plug in a mini USB cable and if you followed the instructions for installing the tweaked FTDI drivers you should have a USB serial port in your device settings. The modules come programmed to run at the standard Windows 9600 Baud rate, we are going to change that.

I'm duplicating some of what is included on the Xbee Radios website, however they used AT commands and I found that a bit of a faff as the module goes to sleep after a few seconds. I would recommend using the excellent XRF Config Manager.


Click search and the software will scan com ports until it finds the module. Then you need to click Download Config. That will load into the manager the settings of your module.
Click the box next to Baud Rate(ATBD) and enter 7A12, this is 31250 in hexadecimal and is the baud rate that MIDI runs at.
Click Upload Config followed by Write Config
Unplug the USB cable and reinsert it, this resets the module.

WARNING this is the single most confusing part the programming because you have to have made sure you had installed the MIDIfied version of the FTDI drivers, otherwise you wont be able to talk to the module anymore.

Open the XRF config software and change the Baud rate to 38400. Thanks to the drivers Windows doesn't know that you are really using 31250 Baud! Click search and it will find your module again.



Notice how although we have set the config software to 38400 Baud the module is actually running at 31250 Baud.

The next part is optional, but I decided to lower the output power from the modules as they can in theory transmit line of sight 3 kilometers! thats a lot more than we need in a studio lol

Click advanced and change Power Level(ATPL) to 0 dbm
This will drop the output considerably and should hopefully prevent your new toy from interfering with other electronics. With the added benefit of using less battery power. If you find that it's not up to the job you can always up the power again. Until you are more confident with what you are doing I would recommend that you leave all the other settings well alone. Click Upload Config followed by Write Config

That's one module done.  In theory it is possible to only program one module and leave the XRF protocol to figure everything out. I would recommend programming both modules as this will prevent putting the wrong one inside the Monotribe and it will in fact not matter as they will both have been set up the same.

You should now have two XRF modules set up at 31250 Baud and are ready to install one of them inside the Monotribe.

You will need for next bit;
XRF breakout board
XRF module(programmed at 31250 baud)
wired Serial connector
0.1uf electrolytic capacitor
some very thin solder, I used 0.7mm
a small wattage soldering iron with a small tip
Philips head screwdriver
side snips
some sellotape
A comfortable and well lit area to work and a bit of patience

Begin by building the breakout board, some come ready built, mine had to be assembled by soldering on the two black strips the pins from the XRF module will go into. If you buy the same cables as me, the following colours match these connections.

Red - DOUT(TX)
White - DIN(RX)
Yellow - 3.3 Volts(3V3)
Orange - Ground(GND)

There is only these four connections needed, so if your cable has different coloured wires or in a different order then make sure you familiarise yourself with how they connect at the Monotribe serial connector.
The serial connector on the left side of the board is a white socket and the pin connections as you look at it are;

1 - N/A
2 - RX
3 - TX
4 - 3.3 Volts
5 - Ground
6 - N/A

Remember that TX on the Monotribe has to go to RX on the XRF module breakout board and likewise RX on the Montribe needs to connect to TX on the breakout board.  To keep this neat I used sidesnips to remove the unneeded wires at the serial connector end.

I found it easiest to secure the small circuit board on a large blob of  blue-tack.  Push the electrolytic capacitors legs into the board in the holes marked 3V3 and GND making sure that the Negative leg is through GND. Bend it slightly forwards. This will stabalise the capacitor and prevent it from flopping about.  Solder the wires one at a time to the corresponding connections.

When finished turn the board over and use side snips to remove and long bits of wire or solder to neaten things up. Thats all there is to do with the board.

Install the XRF module into the pin connections being careful to make sure its the correct way round. You want the ariel end the same as the wires.


This is how it should look.
Now we are going to install the module inside the Monotribe.  Place the 'tribe face down onto a towel or a microfibre cloth to stop it getting scratched or damaged, then remove the rubber feet by teasing them away from the outside edge inwards.  They are only held on by double sided tape and come away quite easily.
Remove the four case screws from the base with the philips head screwdriver.


Turn the Monotribe over with the power button and other connections towards you. Lift the the top case away from you and let it rest on it's side


I have highlighted the power connector, gently tease this out of the socket.

Remove the four silver screws from the power strip .

There is a space to the right of the battery compartment that fit the module and breakout board perfectly.  Install the module there on it's side and run the cable under where the power strip goes.  Secure the power strip again with the four screws being careful not to snag the cable.  Then tape the ariel to the back of the battery compartment, use the following pictures for reference.
Replace the power connector and plug the serial connector from our new cable into the board of the monotribe where it says Serial.



Close the case and replace the screws and rubber feet.  The upgrade is done and hopefully when you turn on your Monotribe it will spring into life giving no hint of what is inside.
If it does nothing at all check that you screwed down the connections on the power strip correctly and everything is plugged in okay.

Lets do a simple test to make sure everything is working as it should be.

Make sure you have the USB programmer with the other XRF module connected to your PC then open XRF Config.  Click the tab for serial monitor and change word wrap to 80 columns.

Switch on your Monotribe and after a second or so you should see stuff filling the screen.  If you do nothing it'll fill up with question marks.  Try running your finger up and down the keyboard on the 'tribe and press play for it to play whatever you have in there. The screen will fill with odd looking ASCII characters.  This is the MIDI data being received as serial data on the PC.


This means that, at least everything is working just fine receiving from the monotribe.  To test sending MIDI data I recommend the serial to MIDI driver by Korg.

As a precaution I changed the output of the USB com port to 38400, the same as we used to connect through the XRF configuration software.


Change the preferences in Windows Audio to use the Korg output for MIDI then load a MIDI file into Windows Media Player and see what happens.
I can guarantee it wont sound pretty, but if your Monotribe makes a noise, it's getting MIDI.

That's everything working, go experiment.  I use the most excellent rtpMIDI to connect my iPad to the Monotribe over a WiFi/wireless link.  Of course, you can use whatever MIDI keyboard you like connected to your PC as long as you route it to the Korg MIDI output connection.

Adding Wireless MIDI to your own Korg Monotribe

Let me first say that I have been fortunate.  A lot of good people have done lots of ground work for this project to happen at all, the internet is a wonderful thing indeed.

You are going to need quite a bit of patience for this project and all the software I have used is for a Windows PC.  That's not to say that you cannot use a Mac, there maybe equivalent software to use.

In my opinion it's the software that makes this project work so well, the hardware is only half the story and can be completed in an afternoon if you are thorough.  There are drivers to install to your PC and a little knowledge of how Windows works will help you a lot if you get into trouble.

Before building I would recommend you visit Xbee Radios and follow their tutorial for installing the FTDI drivers. You will need the XRF module and a USB programmer board for this. They have tweaked them so that you can run the modules at 31250 Baud yet trick Windows into thinking you have selected 38400 Baud.

There is also a link there for grabbing the Korg MIDI serial driver, however I think Korg have messed with the list as I could not find it, so go HERE and scroll down the page to find it.

To make programming the modules easier I would recommend going HERE and downloading the XFR config manager. I use it in the tutorial and it'll make changing stuff so much easier than remembering AT commands.

Wireless MIDI

Wireless is everything at the moment and actually darn useful in the studio with small portable gear like a Monotribe.  I wanted to add MIDI to it and after looking at what others had done, didn't look that difficult.  However I did not fancy drilling holes in the nice case or compromising in anyway the use of it with my other gear.  I had a weeks holiday and it was wet and cold outside, so I set about finding out more.

Game Boy Genius has done good work here, an amazing blog with lots of useful information on adding MIDI and other stuff to your 'tribe.  This was in fact my original plan with adding MIDI to my Monotribe, however it was while waiting for some serial connectors to arrive from HK I came accross this guy; Air Variable. A lot of beta testing and good work done there.  I wanted to have a go myself but the modules used are relatively expensive and I didn't fancy all that veroboard soldering :(

A quick search on eBay found me some modules in HK, but I didn't fancy waiting so looked again.  A supplier of equivalent modules in the UK was found for a similar price.

Adding something cool to the Monotribe

I have wanted for some time now to do something cool with my Monotribe.  It works great on it's own and yes I can sync it to other gear rather well using the App on my iPhone. But then some nice people started experimenting with the insides of the beast and found that Korg had left all kinds of clues for people to hack it.

A quick google search will show that only a few have blogged their modding and YouTube is equally sparse with information. However it was with this information I set about hacking my own 'tribe.

First and foremost I wanted to keep the mod "stealth" and give no clue it was there.  It had to work flawlessly and without anything to set up each time I wanted to use it. Finally I wanted it to work on the internal battery pack and not be tied to a wall-wart every time I used it.

Had I got the foresight to have started this blog before I started it would probably look more impressive, however it was after posting on the most excellent Muffwiggler forum, that I decided to go ahead with documenting my upgrade.

Korg Monotribe

Okay, I admit it, I bought the Korg Monotribe on impulse because it looks cool. It's got that Jim Kelly 1970's vibe about it, big brash shiny levers and flashing lights, the "Tribe" is good Kung Fu.

Next to other gear I own it's not half as useful, only got a single memory and cannot remember any of the settings. Why then do I find myself writing little tunes and wasting hours and hours with it then? because its fun that's why! Many of us will admit to owning more electronics gear than is strictly necessary for creating music, however most of it is so darn complicated that the manual is needed to do anything other than switch it on :(

Not so the 'tribe.  You just twiddle the little nobs and tweak away, record a basic tune and mess with it. Record some drums and mess with it. Fun! you remember when using synths was fun?