Archive for July, 2024

Retro Adventures Continue: the Color Computer 2

Sunday, July 14th, 2024

CoCo Basics

OK, so having conquered Grant’s Six Five Chip 6809 Computer, or at least getting it to work and writing some assembly language programs for it, I wanted to work with a more capable 6809 based machine. Minimum required additions: a video display and built-in keyboard. The Radio Shack Color Computer (CoCo) 3 looked promising but they’re hard to find and fairly expensive. Then I got lucky and found a working $70 16K CoCo 2 at VCF East.

Upgrading it to 64K was dead easy, eight 4164 chips courtesy of AliExpress and solder one jumper and I had maxed out the RAM. The older BASIC ROM got replaced with an EPROM and small adapter board and I now have a top end (1980s era) CoCo 2. The one remaining hardware change I’d like to make is replacing the RF modulator module with a composite video board. I found a nice one on Zippster’s Web Site but he doesn’t seem active and hasn’t responded to my emails so I haven’t been able to get one as yet. I did find instructions for altering the RF module to composite, but if that failed I’d have a dead CoCo 2 with no easy way back to making it work again. I’d rather not take that risk. If anyone knows of a source for buying a Type A (vertical) composite video module I’d very much appreciate a link.

CoCo 2 Architecture

It’s a pretty basic setup for a 6809 computer that comes with some significant software challenges as a result. Pretty much everything is implemented in bare-minimal hardware. The keyboard is exposed as a raw key matrix that needs software scanning to detect keypresses. The serial port is an input bit and an output bit with no hardware serial chip, so serial communications means software bit-banging. And the cassette interface is just a single input bit and a six bit D to A converter output; all encoding and decoding is handled in software. And with no interrupt support, not even a timer, you can do one thing at a time and timing is by counting CPU clock cycles. Pretty significant limitations. But also about as simple as you can usefully get. Everything else is just code.

Software Plan

I had definite plans for how to proceed on the software side. First get my G6CC Demon debugger running on the CoCo2, then use that to bring up my other apps: Alf and Syl.

But before I could even consider starting that work I had to come up with a way to get my code into the CoCo. A plug-in EPROM cartridge with an SD card interface might be my ultimate goal but I wanted to start simply so the existing CoCo cassette interface was my target. No hardware modification required. I just needed a way to convert my LWTOOLS generated Intel HEX into whatever analog format the CoCo expected.

And so project number one was born: CoCoCass.

Retro Adventures: the 6809: the Hardware

Tuesday, July 9th, 2024

Back in the mist of time, in the primordial swamps of tech, (AKA the 70s and 80s), I did embedded programming for a living. I learned to love the 8080, 8085, Z80 and even, grudgingly, the 6502. But there was a siren call I never answered: the Motorola 6809. It looked like a minicomputer: reasonable 16 bit ops, general purpose index registers including a spare stack pointer, even multiply (well, 8 x 8 bits but still.) But I could never justify the expense of building a system around it so I never got to play with one.

Grant’s Six Chip 6809 Computer

Then a few years ago I had a health issue that resulted in a few months of resting and relaxing, and boredom. While browsing the Net I ran across this article:

Grant’s 6-chip 6809 computer

A six chip 6809 computer. No video or keyboard support. Just 32KB RAM, 16KB EPROM and a serial port. A perfect minimal machine to learn the 6809. A quick pass through Ali Express and I realized I could get all the chips I needed for about $20(US). Actually I could get enough for about five of them. In the end I left off the RS232 chip and just used an FTDI cable. And since I had a 32KB EPROM on hand I added a bank-select jumper for two 16KB banks.

Assembly went surprisingly easily. I did have to cobble up an EPROM programmer from an ESP8266 board, which I will hopefully document later. But it worked and I burned a version of BASIC to play with. Then the real fun started. I rewrote my old Z80 debugger (Demon) for the 6809, got a FORTH-like language running (Alf) and implemented a minimal LISP (Syl) to get a feel for how well the 6809 handles things. It handles them VERY well as it turns out. I love writing code for it as I seem to spend less time fighting the architecture to do what I want than on x80 CPUs.

But I wanted more and started looking for hardware that supported at least memory mapped video and a keyboard. And that’s how I landed on the venerable Radio Shack Color Computer 2.

The CoCo 2

I was actually hunting for a CoCo 3 because it supports a lot more banked-switched memory and has other improvements. But at VCF East I found a boxed CoCo 2 for $70 and took a chance. It worked albeit with VHF RF output to a TV rather than composite (if anyone has a lead on where I can get a composite card [type A?, the vertical mount one] please let me know.) The built-in BASIC runs fine and I even managed to download a few “cassette” based apps I found on The TRS-80 Color Computer Archive using my laptop. Next step was obviously to start working on my own apps including porting Demon, Alf and Syl to the CoCo.

I was considering making a SD or CF card cartridge for storage but wouldn’t it be cool to be able to download apps via the cassette port without needing another actual computer? Thus was born CoCoCass, an ESP32 based gadget that lets you load and save BASIC and machine language programs like it was the 80s: very, very slowly. But it should work on any CoCo without hardware modification needed. I’ll post the details of that here sometime soon.

Which is basically where things stand today.

A Small Matter of Programming

Since the hardware is settled, at least for now, next step is writing some code. At the moment I have Demon running pretty well on the CoCo, including cassette load and save commands. Next will probably be packaging up my basic I/O (display, keyboard, cassette) so I can use them in Alf and Syl. After than maybe add CoCo specific graphics support?

So that’s installment 1 of N of my Retro-computing Adventures on the 6809. Feel free to prod me if you have any questions or if you suspect I’ve gotten distracted and stopped posting again.

Dave

Next: the CoCo 2

Retro Adventures

Tuesday, July 9th, 2024

After a LONG lapse I’m going to attempt to justify hosting this site by actually posting stuff! Naturally, it will be retro-computing related because that’s kind of what I’m spending a lot of time doing of late. It’s a nice antidote to wrangling code signing and oddball Info.plist problems. So, hopefully, there will be regular posts here again. So maybe stay tuned?

First up: Retro Adventures with the 6809