C64 Keyboard – It’s alive – More!

Straight as a laser beam!

img_3146

All the keys line up nearly perfectly. There’s a couple of ‘iffy’ ones that need re-soldering, but I’m far too excited to bother with little things like that

And. here’s the first fit…………..(complete with Spectrum magazine mouse mat!)

7c8495a2-4d2f-4ffd-ac2d-1ca37030a4e6

 

All that’s great that the hardware’s complete – But, the software will make this work.

Fortunately, the arduino has some great examples out there that turn a conventional C64 keyboard into a USB Keyboard!

https://github.com/dabonetn/C64USBKey/tree/master/C64Key3-ProMicro

http://www.lemon64.com/forum/viewtopic.php?t=55650

are a couple that I’ve found – it should have been as simple as use my own schematic / matrix mapping – very easy – There’s enough pins on theArduino Pro Micro that I’m using for a 9×9 matrix – So, we get to have Restore also!

schematic c64mini

Keyboard matrixes are ‘fun’ when they don’t work first time….I’m not brand new to Arduino stuff but i’m no expert either, I just muddle through and try to figure out as I go along, Youtube’s great, as are dozens of other sources…

Arduino’s are ‘fun’ in that each pin has multiple pseudonyms depending on what’s doing the programming

I’ve found a superb link which proved extremely useful much later on in getting this going

https://deskthority.net/wiki/Arduino_Pro_Micro#Pinout

 

And, the main culprit –

The original Arduino map had the following in for the rows and columns, this 8×10 matrix has enough positions to allow joysticks to work also –

The code below simply says which pin of the arduino connects to which pin on the keyboard matrix above!

//int RowPinMap[8] = {12, 6, 7, 8, 9, 10, 11, 5};
//int ColPinMap[10] = {13, 14, 15, 20, 17, 18, 19, 16, 1, 2};

 

And, after much, much trial, error, swapping numbers around and head scratching……This is what I needed to change my code to

int RowPinMap[8] = {9, 3, 4, 5, 6, 7, 8, 2};
int ColPinMap[10] = {10, 16, 14, 21, 18, 19, 20, 15, 1, 0};
Which, resulted in the Arduino being recognised in Windows and………..

 

Buzzing! – BUT, there’s a bit of a problem.

This code doesn’t work with the C64 Mini!

For some reason, the Mini’s mini-linux OS won’t recognise the Arduino’s USB ID and, Basic brings up nothing…..

Back to Google

Author: bleughbleugh

Early Fourties, Wife, two kids in primary school. Both of us work full time...3 years now Back in Blighty after a decade away...It's a new country for everyone! Still finding time to tinker!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s