Here's a project I was tempted to mention on 6502.org -- but it makes more sense to post it here!
As you can see from the diagram, this is a computer with
two 1.5 MHz 6809 CPU's attached to a shared memory array. 65C02 and Hitachi 6309 would also have been viable CPU choices, but in the pre-Internet early 80's when I built this, 6809 seemed like the hottest thing going!
Attachment:
6809 computer block diagram.gif
The "master" CPU (on the left) runs the user application, and the "slave" CPU on the right functions as a smart peripheral. The slave CPU
can run normal code, but its main duty is as the address counter for a Don Lancaster style "Cheap Video" system, rapidly reading consecutive memory locations so the data can be output as pixels.
The two CPU's require no arbitration and no Wait States because the DRAM array is capable of 3 million accesses per second -- twice what each CPU requires, allowing the two to simply take turns on alternate clock phases. Nowadays it seems strange that the memory speed is double that of the CPU's. It's such a conspicuous contrast with modern PC's, whose CPU's are
far faster than memory -- so much so that elaborate on-chip caches are the only way to avoid horrific performance penalties!
The video system teases anomalous behavior out of the slave CPU by disabling the '245 that connects its data bus to RAM and instead feeding the CPU dummy op-codes -- essentially NOP's -- throughout each horizontal scan line. In response, the CPU produces a linear, ascending sequence on its address bus, fulfilling a function like that of a DMA controller. For more detail please see the section, "Cheap Video and Lying To the Machine,"
here.
In this particular machine, the byte strings fetched from RAM can be output either in bit-mapped mode or as a character-oriented display.
- In bit-mapped mode, each byte fetched from memory contains four adjacent two-bit fields. Each two-bit field corresponds to one pixel on screen. The two-bit value acts as a lookup, selecting one of four gray-scale values stored in a 74_670 register file used as a "palette" RAM. The DAC is a simple weighted resistor network.
- In character mode, basic ASCII encoding applies when bit 7 of a character is clear. Two options are associated with bit 7 being set. Either reverse video appears (courtesy of an XOR gate, not shown), or else custom characters are selected which have been uploaded to the RAM portion of the Character Generator.
Operating two processors from a single memory array involves some fancy footwork in regard to interrupt vectors. In order to provide vectors which are specific to each CPU, one CPU has the top portion of its address map slightly distorted. Whenever that CPU accesses the top 512 bytes in the 64K range, an XOR gate in address line A8 inverts that signal before it gets sent to RAM. The effect is to exchange the 256-byte page at $F
F00 with the page at $F
E00, but only from one CPU's point of view. Each CPU thinks its vectors are fetched from page $FF00 but -- like the phantom DMA controller mentioned earlier -- it's all done with smoke and mirrors!
Of course the 6809 is a highly Forth-ophilic CPU!
And, right from the start, my goal was that this machine would run FIG Forth. I'd had an offer to supply the necessary files (this was pre-Internet, remember); but, as more and more time went by, it became clear I would either have to find another source or manually type in the code myself (I did have printed FIG doc on hand). Instead the project got shelved, because during the delay
an even more ambitious Forth project had caught my fancy. I'm pleased with this dual 6809 design -- well, mostly!
-- and maybe someday I'll pick it up again, but so far the machine has gotten no further than some basic debugging of the I/O and video systems.
Today I'm happy to dust off this project (literally) and present it to the anycpu.org forum. The unit itself may be somewhat the worse for wear -- I notice quite a few IC's have gotten "borrowed" over the years -- and my memory of the details is spotty, but I'll do my best to answer questions if there are any.
cheers
Jeff
edit: extra detail in diagram & text
edit: More tweaks. Fix broken link. Mention 6309 and 65C02. Add 2nd-last paragraph.
Attachment:
dual 6809 single board computer.jpg