C64 Mini Keyboard Kit – The Code and the Schematic!

Hi All – here goes

I’ve submitted a Pull request to the QMK Github to add the Mini !

https://github.com/qmk/qmk_firmware/pull/14159

And, here’s the firmware in a ZIP file to help

https://drive.google.com/file/d/1WVuZMWLF9_7ZtnlxLih7IebWrD0SbX_b/view?usp=sharing

That’s the QMK Code For the Arduino used inside the C64 Mini

How To Compile

Download QMK – I recommend QMK MSYS. Get it installed

There’s plenty of tutorials around

BUt, quick and easy – Unzip the above file to the KEYBOARDS folder

C:\Users\YOURCOMPUTERNAME\qmk_firmware\keyboards\

Then fire up a command prompt (Start, search, CMD, run)

and navigate to the the above folder

then run

qmk compile -kb c64 -km default

You’ll get a c64_default.hex file appear in

C:\Users\YOURCOMPUTERNAME\qmk_firmware\builds\

Now to flash –

Download QMK TOOLBOX

Arduino leonardo’s can be a little tricky to flash hex files to – be persistant – there’s two Tools that help

QMK TOOLBOX – that shows the keyboard enumerating when you plug in

Set it to ‘auto flash’ and you can try pressing / holding b and space (it’s configured as a magickey in QMK) to get the bootoader to kick in and flash the chip

If anyone knows a quicker way – shout!

And, if it helps

Here’s the Schematic

No PCB gerbers are public yet – play away! any suggestions, happy to look at incorporating them

I’ll follow in the future with more insight in how this lot works, and also modifications needed to get it going better… There’s a LOT to it as the Keycodes – https://sta.c64.org/cbm64pet.html

Don’t map to the HID codes used by USB…so, without some super customisation, certain combinations may never be possible

Some useful resources

https://www.c64-wiki.com/wiki/Keyboard

https://msys.qmk.fm/

https://github.com/qmk/qmk_firmware

https://github.com/qmk/qmk_toolbox

https://thec64community.online/thread/688/c64-keyboard-mapping

and a few other C64 USB firmware’s i’ve found – these may have the bits needed to be able to get mine working much better – But, merging things is currently beyond my skillset – I’ll figure it out eventually

https://symlink.dk/projects/c64key/ – Has seemingly sorted out shifting, etc with custom codes. I can’t quite figure it out though

And, this awesome public project! – If you want a ready made USB interface – This looks great. Has some quite complex QMK mapping that i’ve not been able to understand – maybe it can be modded for my PCB!.

Flashing .Hex Files – ‘painful’ – a solution

Wow, What a few weeks this has been.

My previous QMK on my small dev laptop worked great. However, moving the directories over to my new laptop (after the kids smashed the old one) – Not working so great

I was now stuck with a handful of ‘blank’ arduinos and no way to update the firmware code, nor any easy way to flash the .hex files to them

Long story short – a friend familiar with programming Arduinos found me this

https://github.com/p1ne/arduino-leonardo-uploader

It didn’t work!….BUT playing aroudn. it at least did pickup something

So….Digging further…I found

https://github.com/p1ne/arduino-leonardo-uploader/issues/5#issuecomment-407583517

I tried the code, didn’t work

Tried again and………Woooo!

  • C:\1leo\arduino-leonardo-uploader-master\windows>testu
    Upgrade procedure starting.
    Missing parameter or file, you should provide the full filename of an existing .hex file you want to use.
  • C:\1leo\arduino-leonardo-uploader-master\windows>testu C64_default.hex
    Upgrade procedure starting.
    Com Port for Arduino device is detected as COM7.
    Reset Arduino into bootloader
    Com Port for Arduino bootloader device is detected as COM6.
  • Starting AVR Downloader/UploaDEr…..
  • Connecting to programmer: .
    Found programmer: Id = “CATERIN”; type = S
    Software Version = 1.0; No Hardware Version given.
    Programmer supports auto addr increment.
    Programmer supports buffered memory access with buffersize=128 bytes.
  • Programmer supports the following devices:
    Device code: 0x44
  • avrdude: AVR device initialized and ready to accept instructions
  • Reading | ################################################## | 100% 0.00s
  • avrdude: Device signature = 0x1e9587 (probably m32u4)
    avrdude: reading input file “C64_default.hex”
    avrdude: input file C64_default.hex auto detected as Intel Hex
    avrdude: writing flash (22924 bytes):
  • Writing | ################################################## | 100% 2.09s
  • avrdude: 22924 bytes of flash written
    avrdude: verifying flash memory against C64_default.hex:
    avrdude: load data flash data from input file C64_default.hex:
    avrdude: input file C64_default.hex auto detected as Intel Hex
    avrdude: input file C64_default.hex contains 22924 bytes
    avrdude: reading on-chip flash data:
  • Reading | ################################################## | 100% 0.46s
  • avrdude: verifying …
    avrdude: 22924 bytes of flash verified
  • avrdude: safemode: Fuses OK (E:CB, H:D8, L:FF)
  • avrdude done. Thank you.
  • Upgrade done!
    C:\1leo\arduino-leonardo-uploader-master\windows>

So, where i’m at now……

I can actually program up arduinos for Mini keyboard kits!

The printer actually seems to be functioning

I’m back in Business

What’s next though

Figure out QMK, I’ve found a lovely chap who’s helping out a bit to compile my keyboard into the new version of QMK being used….then I can finally start doing some development again!

and, more importantly, get this C64Mini keyboard listed in QMK for you guys to be able to easily play with the firmware….

Errors!, Errors!

Having some fun with the printer this past few weeks. many, many fails

Lightly used, honest

Some possible lessons learned….

1 – Don’t mix Resin brands and pigments in untested combinations

I’d ordered a bunch of ‘expired’ Elegoo translucent green resin, going ridiculously cheap, (like 1/3rd the price it should be) it prints FANTASTICALLY…BUT

….I normally use Anycubic Clear, just because it’s what i started with, and it works.

I also add various pigments from http://resin8.co.uk

Mixing in an old batch of C64 Brown with the new Elegoo didn’t really work. I had 6 failures in a row – which i’d assumed was the FEP or me doing something silly / bad levelling . The 7th failure punctured the FEP! At that point i’d realised what i’d done (mixing all the stuff together) so, ordered some new Clear resin. I got a perfect print straight away!

The thing you see above is me, changing the supports (finally) after having issues with the old base layer being too thick and seperating from the build plate. I’d gotten around this by using longer base exposures, but still, had more failures than I’d like.

Hopefully now i’ve new FEP, new resin, and spent a couple of hours doing the supports properly, I’ll get a fresh print tomorrow!

anyone good with QMK?

My next issue – as you can see above…QMK. I spent weeks learning how to, and setting up QMK on my old laptop, which the kids smashed.

QMK has moved on a little it seems as now there’s a dedicated QMK MSYS32 installation…BUT, it doesn’t compile my old keyboard layout. if there’s anyone good with QMK out there, give me a shout!. I’ve no doubt I can get things working again to work on the code a little, just pressed for time for the next month or two and, i’m getting the coding itch this past few days 😛

Quick trick for supports for resin

Who knows if it’ll work yet, but whilst trying to support a large, flat, thin surface for printing, I found that the slicing software didn’t really seem to ‘get it’

So, I tricked it a little by adding the seeds for supports inside Fusion360

Essentially this is just creating a grid of ‘support tips’ and merging them with the wanted body.

The slicer software sees these tiny sticky-outy bits and has no choice other than to add supports to them

alternatley, they can serve as a grid for you to add some manual ‘heavy duty’ supports and surround with more medium duty ones

This is a large flat lower part of a case.

Angle it by 45 degrees. This makes it short enough to print, and easy to support and add some ‘zits’ on a grid

Closeup of zits on a grid

By adding an easy ‘pattern’ of 0.5mm high by 0.1mm diameter zits, I trick Lychee into supporting those areas.

The End result – Evenly spaced ‘starter’ supports that can be manually supplemented. This ensures that no points of the model will be droopy.

I’ve started with a grid around 10x10mm. no reason why this grid can’t be a bit smaller, just some experimenting needed

A mix of things – and, the Semiconductor shortage and Kits – Running low on arduinos

First – A small project being worked on in the background. I’ve been struggling to keep the momentum going on the blinkenator – for a myriad of reasons, so i’ve distracted myself a little with ‘something shiny’ which at last count has nearly 200 items in the BOM, including 70 3D Printed parts!

The picture shows the lower half – revision 4 after being supported and currently on the resin printer! has to be at an angle as it’s just a little bit too tall to print vertically in the Anycubic Photon Mono

Ain’t gonna give any more information until this one’s working and ‘ready’ – just the odd vague teaser here and there

The other thing – The Semiconductor shortage…I’m having to pause briefly the C64 Mini keyboard projects as i’ve run out of Arduinos.

Unfortunatley, they’ve now tripled in Landed price in most places since I started purchasing them!

The switches have gone up 50%,

The Diodes have gone up 100%

That now means, at £30 a basic kit, profit margin’s a little slim..I may need to raise the price to £35 at some point, I just need to make some time to take stock of what parts I have and re-price based upon being able to order more when this lot runs out.

Amusing that it’s the arduinos as i’ve 50 of the wrong type still here – I’m going to try selling them to make some $$ 😛

[edit – as typing this, i’ve found a local seller at old prices!, I just snapped up 10 arduinos at a fiver a pop – will be kitting up over the weekend]