Wednesday, March 6, 2013

Lists of Requirements (and some notes on the red wire)

In which our protagonist bravely faces his own ignorance and draws up a list of things to learn, do, and buy, which turns out to be longer than expected.

There's one small problem with my cunning plan to build a computer: I know jack about practical electronics. The theoretical basics, yes. Things like Ohm's Law, sure. But as for hands-on, build-that-circuit, I have to google to figure out if the red or the black wire is plus. Here lies the greatest danger to the project: Plugging wires and soldering resistors might turn out to be boring, and then everything could end up half-finished on a shelf in the garage. Wouldn't be the first time.

So before this went any further, I bought a digital electronics experiment kit for about 14 euros. It contains two ICs (4011 dual NAND and 4027 dual JK-flipflop), a few small parts such as resistors and LEDs, runs off a nine volt battery, and comes with a booklet of 20 simple experiments. The idea: If that turns out to be boring or frustrating, I abort the whole project and I go off and try to finally find the Amulet of Yendor or something.

The beginnings of an experiment from the kit. Note forceps on the right. Unfortunately, it produces too much pressure to be of much use.

Since you are reading this, it wasn't boring. In fact, it was fun, and I learned a bunch of basics. As a bonus, there were some mistakes in the manual. That forced me to build the circuits using the diagrams and gave me some first-hand experience with hardware debugging.

So, the red wire is plus. What else do you have to know, do, and buy to build a computer?

First and most importantly, you have to read. A lot. Starting with the Website, especially the 6502 Primer. Then, pretty much everything else on that site. Basic electronics is a must: Reading teaches you to use a tantalum capacitor at the power jack, but more reading teaches you that they can blow up in your face if you put them in the wrong way around (which I guess is why the red wire thing is so important). You'll need to read datasheets, and then re-read them, until you know what the difference between a 65c22N and 65c22S is and what the BE pin of the 65c02 does. None of this, by the way, is the sort of knowledge that makes you a hit at cocktail parties.

Other things you need to know. Basic practical electronics (including how to solder), basic digital electronics (logic circuits, how to read a datasheet), boolean logic, 6502 assembler programming, how to use an assembler and an emulator. You also needs lots and lots of paper to jot down notes, ideas and designs. Get a very large recycling bin for said paper, because most of your ideas are going to be crap and the designs horribly wrong.

Since this is not nearly enough, you will also need a cheerful willingness to ask absolutely basic and downright embarrassing questions.

Then there is stuff you need to own or buy. A breadboard for testing, a stabilized 5 V power source, a soldering iron, a digital multimeter, tweezers, an EEPROM programmer (more on that in a later entry), an oscilloscope (if affordable), and a logic tester. Then, obviously, the chips and other electronic components for the computer itself, more chips and other electronic components for tests and experiments, wire, and tools such as stripping pliers. If you need six or more binary digits to write down your age, you might want to think about a magnifying glass. The parts are even smaller than they look on the photos.

Some of this stuff you'll already know or have. In my case, I know enough 6502 assembler to get a program up and running, and enough basic digital electronics to understand how to connect the logic stuff. On the other hand, I'm going to have to earn some serious skill points in basic electronics before this is done. Like, what is a "pull-up resistor" and why would I want one?

After the experience with the digital experiment kit, I went out and bought a large breadboard and a whole bunch of logic chips and small stuff for "freestyle" experiments. None of them really makes for exciting reading, so I'll post a summary entry at some point. For now, know that while we're discussing theoretical stuff here for the next few entries, I'm busy in the background reading datasheets and wiring discrete logic chips together to make little lights blink.

In the next entry, we'll start designing the computer. That's definitely fun.