Jump to content
IGNORED

Unmodified and unopened C64 as a USB keyboard


galax

Recommended Posts

This was a very cheap thing to hack together: the C64 was almost free from a garage sale, and I used an $8 Arduino Pro Micro from Aliexpress. I've seen people connect an Arduino directly to the keyboard output, but I wanted to try something using the user port, as it's a very cool feature of the C64. Also I don't have any way to load or save data on the C64 at the moment, so there wasn't much else I could do with it! (the first project probably should have been a tape adapter...)

 

Hardware-wise, I shared the USB and 5v C64 user port power, and connected the user port data lines from to 8 of the Arduino's pins, configured as digital inputs.

 

The Pro Micro can act as a USB keyboard (so that bit's easy), so all I had to do was 1) Write a 2 line BASIC program (As short as possible as I have to retype it on power on) that dumps a byte to the user port alternately for the currently pressed key and current modifiers (Ctr/Shift/C=), and 2) Convert the 8 data inputs back into a byte in the Arduino, work out the corresponding key pressed, and send it to the USB keyboard. Seemed responsive enough for any lag to be not really noticeable, but I'd like to give it a more thorough test. IThe data could be pushed to the user port quicker by an assembler loop, which would probably decrease the lag.

 

Connecting to the C64 was a bit Heath Robinson, as I don't have a proper user port edge connector and it's quite fiddly to build one. if I can construct a better edge connector or find a proper one I'll finish it off and take some photos.

 

Of course, configurable keys, macros, key combinations for nonexistent keys etc. would all be pretty easy to do in software on the Arduino.

Edited by galax
  • Like 1
Link to comment
Share on other sites

That is very cool, thanks for posting. I actually recently got a couple Arduino units, but haven't had time to dive into them yet, so don't have the knowledge to do this. Neat idea for a project though!

Link to comment
Share on other sites

Getting started with the Arduino is amazingly simple:

  • Download & install the IDE http://arduino.cc/en/main/software
  • Plug your Arduino into your PC using USB
  • Run the IDE and select an example program.
  • Make sure the correct virtual COM port is selected (there should only be one)
  • Hit the 'upload' button

And that's it, you have code running on the Arduino. Change the code, hit upload again, it's that easy.

 

My C64's PSU died (probably the reason it was free), so I had to build another one, and I also built an S-video monitor adapter, which makes the display look way better. I ordered some user port connectors on eBay- when I get them I'll finish this off.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...