You Can Program AVRs From The Commodore 64

These days, most of our microcontroller boards come with bootloaders so you can squirt hex into them straight over USB. However, you don’t need to do things this way. If you’re more old school, you can program your AVRs right from a Commodore 64. [Linus Akesson] shows us how.

Programming an AVR isn’t that hard. By holding the chip in reset, it’s possible to flash code via a serial protocol using just three wires. However, that’s pretty impractical to do with modern PCs — they don’t come with addressable IO pins anymore. Normally, you’d use a dedicated programmer to do the job, but [Linus] found his had died on a Friday night. So he set about turning his C64 into one instead.

He decided to use the pins of the C64’s Joystick Port 2, with pins 1, 2, 3, and 4 hooked up to SCK, MOSI, Reset, and MISO on the AVR, respectively. 5 V and Ground were also provided courtesy of the C64’s port. He then whipped up a simple bit of assembly code to read a bit of AVR hex and spit it out over the Joystick port following the in-circuit programming protocol. With a 1541 Ultimate to load files on to the C64 in hand, it was easy to pull his compiled AVR program off his modern PC, chuck it on the C64, and then get the old Commodore to program the AVR in turn.

It’s not the first time [Linus] has wowed us with a C64 in hand. If you’ve got your own fresh projects for the best-selling computer of all time, don’t hesitate to let us know!

Using Kick Assembler And VS Code To Write C64 Assembler

YouTuber [My Developer Thoughts], a self-confessed middle-aged Software Developer, clearly has a real soft spot for the 6502-based 8-bit era machines such as the Commodore 64 and the VIC-20, for which he has created several video tutorials while travelling through retro-computing. This latest instalment concerns bringing up the toolchain for using the Kick Assembler with VS Code to target the C64, initially via the VICE emulator.

The video offers a comprehensive tutorial on setting up the toolchain on Windows from scratch with minimal knowledge. While some may consider this level of guidance unnecessary, it is extremely helpful for those who wish to get started with a few examples quickly and don’t have the time to go through multiple manuals and Wikis. In that regard, the video does an excellent job.

VS Code is a great tool with a large user base, so it’s not surprising that there’s a plugin for using the Kick Assembler directly from the IDE. You can also easily launch the application onto the emulator with just a push of a button, allowing you to focus on learning and working on your application. Once it runs under emulation, there’s a learning curve for running it on native hardware, but there are plenty of tutorials available for that. While you could code directly on the C64 itself, it’s much more pleasant to use modern tools, revision control, and all the conveniences and not have to endure the challenges.

Once you’ve mastered assembly, it may be time to move on to C or even C++. The Oscar64 compiler is a good choice for that. Next, you may want to show off your new skills on the retro demo scene. Here’s a neat C64 demo with a twist. There is no C64.

Continue reading “Using Kick Assembler And VS Code To Write C64 Assembler”

Generative AI Hits The Commodore 64

Image-generating AIs are typically trained on huge arrays of GPUs and require great wads of processing power to run. Meanwhile, [Nick Bild] has managed to get something similar running on a Commodore 64. (via Tom’s Hardware).

A figure generated by [Nick]’s C64. We shall name him… “Sword Guy”!
As you might imagine, [Nick’s] AI image generator isn’t churning out 4K cyberpunk stills dripping in neon. Instead, he aimed at a smaller target, more befitting the Commodore 64 itself. His image generator creates 8×8 game sprites instead.

[Nick’s] model was trained on 100 retro-inspired sprites that he created himself. He did the training phase on a modern computer, so that the Commodore 64 didn’t have to sweat this difficult task on its feeble 6502 CPU. However, it’s more than capable of generating sprites using the model, thanks to some BASIC code that runs off of the training data. Right now, it takes the C64 about 20 minutes to run through 94 iterations to generate a decent sprite.

8×8 sprites are generally simple enough that you don’t need to be an artist to create them. Nonetheless, [Nick] has shown that modern machine learning techniques can be run on slow archaic hardware, even if there is limited utility in doing so. Video after the break.

Continue reading “Generative AI Hits The Commodore 64”

You Can Use Visual Studio Code To Write Commodore 64 Assembly

Once upon a time, you might have developed for the Commodore 64 using the very machine itself. You’d use the chunky old keyboard, a tape drive, or the 1541 disk drive if you wanted to work faster. These days, though, we have more modern tools that provide a much more comfortable working environment. [My Developer Thoughts] has shared a guide on how to develop for the Commodore 64 using Visual Studio Code on Windows 11.

The video starts right at the beginning from a fresh Windows install, assuming you’ve got no dev tools to start with. It steps through installing git, Java, Kick Assembler, and Visual Studio Code. Beyond that, it even explains how to use these tools in partnership with VICE – the Versatile Commodore Emulator. That’s a key part of the whole shebang—using an emulator on the same machine is a far quicker way to develop than using real Commodore hardware. You can always truck your builds over to an actual C64 when you’ve worked the bugs out!

It’s a great primer for anyone who is new to C64 development and doesn’t know where to start. Plus, we love the idea of bringing modern version control and programming techniques to this ancient platform. Video after the break.

Continue reading “You Can Use Visual Studio Code To Write Commodore 64 Assembly”

Cyanodore 6 Is A Rad Commodore 64 Synthesizer

The Commodore 64 is celebrated to this day for its capable SID sound chip, which provided the soundtrack for some of the best video games of its era. Even today, it’s still in demand as a chiptune synth. [gavinlyons] decided to take a breadbox-style C64 and mod it to be a more dedicated synth platform, creating what he calls the Cyanodore 6.

The build starts by equipping the C64 with MIDI via a C-LAB interface cartridge. Software is loaded on to the C64 via a readily-available SD2ISEC converter, which lets the retro computer run off SD cards. The original SID was removed and replaced with an ARMSID emulator instead, giving the rig stereo output with some custom wiring. Four potentiometers were also added to control various synth parameters by wiring them into the C64’s two joystick ports. There are a variety of synth programs that can run on the C64, with [gavinlyons] noting CynthCart, STATION64, and MicroRhythm as popular choices. Other nifty mods include the keyboard illumination, tube preamp, and integrated 7″ LCD screen.

If you’re looking to start using your C64 as a performance instrument, this build is an excellent starting point. We’ve seen other neat builds in this area before, too. It’s got just about everything you’ll need on stage. Video after the break.

Continue reading “Cyanodore 6 Is A Rad Commodore 64 Synthesizer”

Fixing A C64 With A Cheap $20 Oscilloscope

Modern computers are so fast and complex that we would seldom try and fix them on a component level with simple DIY tools. Working on an early 1980s computer is much easier by comparison, with the fastest signals often in the single-MHz range. [Sayaka] demonstrates this by using a cheap $20 oscilloscope to troubleshoot and repair a Commodore 64.

After powering it up for the first time, the C64 displays a BASIC prompt, but none of the keys seem to work. [Sayaka] did what good hackers do, and immediately disassembled it to try and figure out the problem, suspecting the CIA chip as a likely culprit.

[Sayaka] elected to purchase a cheap DS0138 oscilloscope kit to help troubleshoot the C64. It’s not the most capable thing, with a bandwidth of just 200 KHz, but it’s enough to do some work on an old retro machine. After probing around to check a number of signals, she noted that the CIA’s pins seemed to be very oxidized and suffering poor conductivity. All it took from there was a resolder job, and the computer was repaired.

We’ve seen other cheap scopes with altogether more impressive specs, too. Video after the break. Continue reading “Fixing A C64 With A Cheap $20 Oscilloscope”

Linux On A Commodore 64

We are used to seeing Linux running on almost everything, but we were a bit taken aback to see [semu-c64] running Linux on a Commodore 64. But between the checked-out user name and the caveat that: “it runs extremely slowly and it needs a RAM Expansion Unit”, one can already start piecing together what’s happening here.

The machine running Linux is really a RISC-V32. It just so happens that the CPU is virtual, with the C64 pretending it is a bigger machine. The boot-up appears to take hours, so this is in no way practical, even though the comment is that optimization might be able to get a 10X speed up. It would still be about as slow as you can imagine.

To further add a layer of abstraction, the code hasn’t run yet on real Commodore hardware. Instead, it is running on an emulator. The emulator has “warp” mode to run faster than a real machine, and it is still slow. So think about that before you rush out to volunteer to boot this on your real hardware.

Tricks like this fall into the talking dog category. If a dog can talk, it isn’t that you think it will have something important to say. You just marvel that it can do it at all. Still, we get it. We spend a lot of time doing things at least as pointless. But at least it is fun!

Maybe emulate the whole thing in VR? Or maybe write some virtualization code for the C64 so you can emulate a Linux box and a quantum computer simultaneously.