Zolatron 64 6502 homebrew – a terminal of my own

Early on in the design of the Zolatron 64 6502-based homebrew computer I made the decision that I wasn’t going to bother with attaching a keyboard and monitor. It has a 16×2 LCD display for small stuff. Otherwise, I/O was always going to be via serial.

That means talking to the machine via some kind of terminal software. To date, I’ve been doing this with CuteCom, and sometimes CoolTerm (although that’s a bit flakey on Linux). However, those are GUI programs.

It would be far more convenient to use something that runs in a shell session, from the command line. Here’s why.

The Zolatron 64’s serial port is connected to the serial port of my electronics workbench computer – a LattePanda Alpha. This is the same computer with which I flash the firmware on to the EEPROM chip. And so it’s the computer I’ve been using to talk to the Zolatron via a terminal program.

But I don’t always want to be sitting at the workbench. Sometimes I like to be at my main workstation, or sitting in the living room in front of the fire.

Having a terminal program I can run from the command line would allow me to SSH into the Alpha and talk to the Zolatron using any device – my desktop machine, my laptop, even the iPad running Blink.

The obvious candidate for a command line program is Miniterm. I already have it installed on the Alpha. Alas, it’s not exactly convenient. To work with the Zolatron, there are various parameters I need to set, such as a send delay on each character of 10ms, and replacing carriage returns with line feeds. Some of the parameters are achievable via a configuration file – but not all. Using Miniterm would mean having to manually set those parameters every time I fired it up. A real PITA.

This probably needs some explaining. That’s coming soon.

And so the solution was obvious. Write my own terminal.

In Go, and using a suitable library, getting something basic up and running took only 50-odd lines of code, most of which I already had written for other projects. Receiving is done asynchronously, via a Go routine, so I don’t have to worry about blocking. Sending is done in the main loop.

It’s crude, but it works just fine. And because I wrote it in Go, I can compile it for just about any platform. For example, at some point in the future I might using a Raspberry Pi Zero 2 as a companion computer for the Zolatron, rather than the Alpha.

I intend to develop it further (of course). Logging sessions to a file is an obvious nice-to-have feature.

The code for what I’m calling ZolaTerm (what else?) is on GitHub.

UPDATE: I couldn’t leave it alone, so now it has logging. The required the use of Go routines and channels and whatnot, so it’s not working quite right but is good enough as a debugging aid. Some work to do, but it’s functional.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.