Energy Star — Paleotechnology style!

A while back, I realized that the Z80 was drawing (relatively speaking) a lot of power. I know modern CPUs can both crunch your numbers and cook your dinner; the Intel Core i7 datasheet specifies a maximum of 145 AMPS of current. (I don’t think my car’s starter motor draws that much, some days.)

The Z80, though, being from the ancient glory days of yore when CPUs didn’t even require a heatsink, let alone sophisticated cryogenics, didn’t really strike me as a power hog. In fact, the version the DrACo/Z80 uses is CMOS-based (for static clockability) — it couldn’t be drawing some 700 milliamps of power all on its own, could it?

No, as it turns out. The Z80 itself is quite efficient. The 74LS245 buffer chips, on the other hand, draw 40 or 50 mA apiece, even when doing absolutely nothing. They just sit there and get warm! “Low-power Schottky,” my paleotechnological posterior!

A quick look online turned up the drop-in replacement 74HCT245 version, which is much more power-friendly. (These only draw a few microamps when idle.) The results speak for themselves…

Much more Earth-friendly! (…and now the computer can be run from a USB port or from NiMH batteries. Whether the Department of Security Theater would let me on a plane or on Amtrak with it is most likely another story, though.)

I’m also experimenting with removing the ‘245 chips connecting the Z80 to the bus. It works well enough to do the Prime Number program, but may not be as stable for high-speed operation. More on this later (time permitting).

Posted in Digital, DrACo/Z80, Drexel | Leave a comment

Prime Time

…and now, for something completely different. (By different, I mean almost useful!)

The Z80 computer is now busy computing prime numbers! I wrote a straightforward BASIC program, which I then compiled using Oshonsoft‘s Z80 simulator suite of utilities. The resulting assembly program was pretty good, but needed some optimization. (BASIC isn’t really geared towards byte manipulations.) I replaced the crude BASIC mod-and-div output routines I had written with four LD and four OUT instructions. Here is the (probably still really inefficient) assembly code.

Some technical progress, too: Loading complex programs is becoming progressively easier with the addition of a hex editor to my toolkit. Instead of toggling code in a byte at a time from the control panel, I can now load it into a serial EEPROM and plug it into the Virtual ROM peripheral. With a few lines of code (which I also copied to the ROM because I’m lazy), this code can be copied into base memory automagically. All that needs to be toggled in to start is a single, 3-byte JUMP command.

For instance, to bootload the prime-number program into base memory:
* Enter Program mode
* Connect the ROM
* Start the clock running
* Load the following instruction into memory:
0000 C3
0001 00
0002 86
* Hold down RESET, exit Program mode, and release RESET.
– The Z80 will jump to 0x8600, which is a quick routine to load the main primes program (8300:854B) into base memory (0000:034B).
– At the end of this routine, a JUMP command will cause it to halt.
* Perform a RESET to start the prime-number program running.

(I actually started loading the bootloader into base memory — but then realized that it would quickly overwrite itself. A workaround, if you don’t have a bootloader written into ROM, would be to toggle in the bootloader at a higher address than you plan to use for the program, then JUMP to that address — for instance, 0x7000h — from 0x0000h.)

I’m using my ancient HP 1630A logic analyzer to look at the output from the program (POD2 connected to the data lines, L clock connected to ~IORQ); it’s calculated the primes through 113 so far.

I also managed to complete Problem 001 from Project Euler (“What is the sum of all numbers less than 1,000 which are multiplies of three or five?”), using the Z80.

I also realized this weekend that my new Gigabyte GA-EX58 Extreme motherboard doesn’t have any RS232 ports. Such is “progress,” I guess. *sigh* Time for an add-in card. (Do they make PCIe RS232 cards??)

Posted in Coding, Digital, DrACo/Z80, Drexel, EET325 | 2 Comments

…and then there were two. Correction, four.

The EET325 class is wrapping up this week, but not before I got Bill’s prototype Z80 core working with the original protoboard control panel. Not only that, but two of the students (Mike and Austin) have finished, working Z80s. So now there are four of them! Can a Beowulf cluster of Z80s be far behind?

Posted in Digital, DrACo/Z80, Drexel, EET325 | Leave a comment

Single-board at last

To paraphrase Emperor Palpatine…

“And now, witness the power of this fully ARMED and OPERATIONAL … Z80 computer!”

OK, so running at the current 40kHz system clock, it’s got more milliamps than megaflops — but at least it’s running properly on one board (CPU, memory, controls, and LEDs all together.)

More about the milliamps to come: it’s currently drawing over half an amp(!) at 5V — almost all of which is going into keeping the 74LS245s warm. The parts should be in tomorrow to give it a quick “Energy Star” upgrade.

Click the image for a larger version. (The dials on the right are, from top to bottom, address-high-byte, address-low-byte, and data.)

Posted in Digital, DrACo/Z80, Drexel, EET325 | Leave a comment