The Mite, a 65C02-based microcomputer

Hardware | Schematics | Software | Photos | Next Steps

The Mite is a simple single-board computer that I designed and built, based on the 65C02 processor. This is essentially the processor that powered the microcomputers of my youth, the ones on which I learned to program -- computers of the late 1970's and early 1980's like the Commodore PET, the Apple II, and the BBC Micro. The difference is that in the 1970s, the original 6502 was based on NMOS technology; the 65C02 is a CMOS implementation that is much more energy-efficient and can run considerably faster.

I chose the name "Mite" to signal that it was small and to express my ambivalence about whether it would actually work. I also liked the idea that the name perhaps foreshadows further designs -- the Mote, say, or the Mate (or even the Mute and the Mete).

If you are interested in these things, there's an amazing collection of resources available on 6502.org that will tell you anything you might need to know about how to design and build anything around a 6502, and a tremendously supportive community of hobbyists in the discussion forum there who are eager to help out new folks. You'll find Garth Wilson's invaluable 6502 Primer there, and that's absolutely the place to start. The design of the Mite has little (yet) that's especially original or unique to distinguish it from the many designs that you'll find via that site such as Grant Searle's minimal design.

Hardware

I've always been a software person; hardware is not my forte at all, which is partly why I embarked on this project in the first place. It's a voyage of discovery, for sure, even though, from a technical perspective, nothing I'm doing is particularly difficult.

The primary elements of the design are a 65C02 clocked at 4MHz, with 32KB of SRAM and 32KB of EEPROM (although some of the ROM space is masked by I/O). The base system has a 6551 ACIA for RS232 serial communication, and two 6522 VIAs for more flexible input and output. The current version also supports PS/2 keyboard input decoded by an ATtiny26 microcontroller, high-resolution video through an RA8875 daughtercard interfaced via SPI, and mass storage on an SD card, also interfaced through SPI. Here is the full parts list:

Jameco, Mouser, and Digikey are all good sources of parts.

For the first couple of years of its life, the Mite was on a solderless breadboard. (Yes, years. I work slowly.) Eventually, I wanted a more solid platform and created a wire-wrap prototype. This version also uses the GAL instead of 74xx logic for address decoding, which gives me a much better decoding with a more compact footprint. On the solderless breadboard, I ran it at 2MHz; the current board is running at 4MHz (and will probably run faster; the lowest-rated part is the 6551).

Schematics

To follow. (I've been promising this for years but it's actually in progress now.)

Software

As the hardware reaches each next stage of evolution, my attention shifts to the software (and then back again). I first wrote a simple monitor for the Mite in 6502 assembly language, which I can use to examine and change memory, enter programs, and run them. It includes a disassembler for the 65C02 (although no assembler; code is cross-assembled from my laptop). Most usefully, I developed and incorporated an implementation of XMODEM within the monitor which let me upload programs from my laptop (since there was no local long-term storage on the Mite at that point). Writing so much code in assembly language involves a process of unlearning lots of automated patterns from high level languages that's really quite enjoyable.

I wrote an ANS-ish implementation of FORTH, also in 6502 assembly language. (ANS-ish means that, where in doubt, it's compatible with the ANS standard, and that as I continue to work on it, it is slowing approaching that spec.) I extended it to include an implementation of the SPI protocol (bit-banged through a 6522 VIA) and of the FAT16 filesystem, which lets me read and write to microSD cards. The machine boots into a simple disk manager program which is actually FORTH in disguise and supports a basic command linen for reading and manipulating files and loading and running executable images. Other programs can call into the FORTH ROM if they want to access mass storage.

The programs I rely on principally are FORTH, a screen editor, and a standalone implementation of YMODEM for file transfers. I have been working on an interactive assembler and disassembler hosted directly on the computer, although it is only partially complete so far. There are also bits and pieces written towards a Pascal compiler.

There is a version of MS Basic running (not in ROM, but it loads from the SD card); I may at some point try to get BBC Basic running.

For software development and cross-assembling on my Mac, I use the xa cross-assembler (I've made some use of ca65, but have yet to port cc65). I've made extensive use of the Symon 6502 simulator, which has a compatible memory map to the Mite and support, in recent updates, for 65C02 opcodes. I have been trying to learn to use KiCad for schematics, but the fact that there's no schematic here yet tells you just how that's been going. (Figuring out KiCad has been harder than designing and building the hardware.) I use Serial as my terminal program.

The github repository for my monitor is at https://github.com/dourish/mitemon, while the Forth system is at https://github.com/dourish/secnd.

Videos and Photos

There are some videos showing various stages of the build on YouTube. And some photos:

Next Steps

Once I have the schematics completed, I will try to lay out a version of this on a PCB. I'd to have a verssion mounted in a 3D-printed case along with the LCD display, with a port for an external keyboard. And I'd really like to implement a Z-machine and port Zork. After that, perhaps, a 6809 machine?