"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." - Antoine de Saint-Exupery
I bought a kit recently which came with a project book, a breadboard and a bunch of discretes to go with the base microcontroller. The contents of that project book represent a lot of the value of the kit: a series of experiments which start with an LED lighting up and build up to more ambitious things. We too should be thinking in terms of a series of steps, where a functioning but primitive 6502 computer is the first step.
Computers need I/O, and they need to boot. Programs have bugs, so you need to debug them. So a newbie computer should be very visible, as well as being simple and needing the fewest external pieces of equipment. It should also be extensible which means exposing the data bus and either the address bus or some decoded addresses.
Looking at the KIM-1, the Fignition, the COSMAC ELF, we don't see a great concern about ergonomics: it's about making something and getting it to do something. The newbie project is not a replacement for a PC.
There are certainly two schools of thought about a serial or USB connection: hooking up to a "proper" computer gives you easy access to copy and paste and a file system, as well as an ergonomic keyboard and screen. But it makes the 6502 less of a computer and more of a peripheral. So a serial connection should be an expansion project. (Using USB purely as a 5V power source is fair game: can run the computer from a phone charger.)
Likewise, once the machine is built and has been bootstrapped, hooking up an alphanumeric LCD display would be a first project, and then perhaps hooking up an improved keyboard. But I'm thinking both of those should not be part of the base design.
So, I'm thinking of a ROMless machine with a front panel type of interface, with everything exposed so it can be built up into something more, but keep all those extras as expansion projects. Eventually it can gain EEPROM, serial connection, mass storage: but it doesn't need those things to start with.
- No ROM. Hook up a 3v battery and a diode to make the RAM non-volatile.
- There must be a single-step capability, for debugging and also for booting.
- Output should be 7-segment displays, on a latch (Not a PIA or VIA because they need to be programmed, and they hide complexity). Need at least 8 bits, which is two digits, on the data bus. Ideally this can be both a peripheral and a data bus monitor, by fiddling the latch enable. Could be discrete LEDs instead of 7-segment, if you're prepared to read binary.
- Preferably, for debug, another four digits to show the address bus. But this is optional.
- Input should be buttons or a keypad. Again, we need a latch if this is to be an input peripheral, but can it also be a front-panel bootstrap device in conjunction with single-step? Minimum is 8 push-buttons or even a tiny and inconvenient 8-wide DIP switch or rotary hex switch. (Maximum is 64 push-buttons and diodes as a key matrix: sounds like an expansion project to me.)
- Blocking input! If we are to key in a bootloader while single-stepping, we want that to be only a few dozen instructions. That bootloader can then free-run, if we arrange that reading the 8-bit input port will stop the machine for each read. The user then flips switches or holds down buttons and presses go, the read completes and the program runs on until the next read.
For bootstrapping, see a
previous conversation, and for a tiny monitor program, see
here.
Edit: see also the
Veronica journey and Ruud's
debugger (
schematic)