I haven't been working on my mainboard design much. (I got distracted with ideas for a USB FRAM/EPROM programmer.) However, I came up with a new address decoding scheme (using a '138), which lead to a more organized (if still unpopulated) memory map.
As before, the low 32k is the SRAM. The high 32k is now split into eight banks of 4k each, the seventh and eighth of which are occupied by the boot FRAM. So it's the same layout as before, but now IO space (or whatever else) has (course grained) address decoding.
Once I got that laid out I started thinking about IO devices. I've got a lot of ideas, but I figured I'd keep the main board pretty bare bones. So I decided to throw a bus on it instead. I've been interested in passive backplanes (like the S100) ever since I first heard of them. However, rather than the traditional edge connectors and separate backplane, I borrowed an idea from the Arduino and sketched out a plan for stackable mezzanine boards.
The bus is pretty dumb, it's mostly just the native interface of the 65C02. After drawing up various concepts and looking at available connectors, I decided to go with two rows of 24 pin sockets. I plan to place the sockets at opposite ends of the board and organized their pinouts accordingly.
The first connector (which I've dubbed the X bus) consists of everything needed for address decoding. Namely, the address bus, write enable, and the clock. Additionally, it has the six available decode lines from the '138, which select 4k banks in the open space between the SRAM and FRAM.
The other connector (the Y bus) has everything else. Which means, the data bus, power rails (+5 and +12), and most of the CPU pins (missing are PHI1O, PHI2O, and /SO). With two grounds (one next to each power rail), this leaves four reserved pins. (Or five if I give up one ground. However, this may not be enough as I've already got extra ideas brewing.)
Originally, I only planned on using twelve bit addressing on the bus (the higher bits are all decoded by the mainboard already), which would've saved a few pins, but then I had a eureka moment that made me change my mind. I realized that, if the bus supported it, I could use the programmer I've been designing in circuit! (I just realized that it could also be used to drive IO boards directly from the PC).
Once I made that change, other good reasons for having the full address bus came to mind, like DMA, and remote debugging. Some of these ideas require additions to the bus that haven't been fully developed. In circuit programming wants to run the clock on it's own terms, so it'd need some method of disabling the mainboard's clock. One of my more sophisticated debugging ideas requires the PC emulating potentially any address, which would require some way of avoiding the onboard address decoding. Simple DMA ought to work with what I've already got defined though.
Another idea contending for the few remaining pins is some sort of reset line. The /RES line is exposed on the bus, so any device that wanted to could conceivably pull it high if it wanted, but that seems like a dirty hack. Furthermore, if that device has a reset connected to /RES, it may not even work at all.
Since it's the device pulling /RES high, it'll reset itself and then it's anybody's guess what state the /RES line'll be in. The reset period may not be long enough for other devices on the bus to properly reset, or, worse, the /RES line may be pulled up indefinitely. Having
any output lines connected to /RES is probably a bad idea, as I'm sure the state of said line
during a reset is undefined for a great many devices, which could reek all kinds of havoc.
What's needed is a dedicated reset output (from the daughter board's POV) the instructs the mainboard's reset circuitry to cleanly reset the machine. So there goes another pin.
One more thing that could be really nice to have once I start developing IO devices would be a programmable interrupt controller. That would require adding additional IRQ lines, so It's likely the bus is going to get larger before I actually implement this.
Anyway, you can check out the latest version of the schematic
here. It's still got no clock and reset sub-circuits. That's my next mission (thanks again for the tips), but before then, I've got a few questions.
First up is another question about unused inputs. For completely unused inputs, things are pretty simple, just tie them to the proper logic level. However, what's I'm wondering about is how to handle inputs that aren't used on the mainboard, but might be used by a mezzanine. Then again, they might not...
For instance, the mainboard doesn't do anything involving interrupts, so it wants /IRQ tied to ground. If the mainboard ties it to ground, what happens when some device tries to bring it high? And if it doesn't work, how do you do it correctly?
It's a similar situation with RDY and BE. However, in this case, for normal operation, the mainboard wants them tied high. So, can they be driven low by something else? It seems to me that one way (tied low or tied high) ought to work and the other one won't. (Unfortunately I don't know enough to be sure which. I wish I could remember more of that electronics class I took (years ago) in high school.)
Either way, you'd end up with some non-functioning inputs. How do you solve this? Use inverters so that the default state is the one that can be driven by others on the bus? Or is there a simpler way?
And now for my other question. I added a simple write protection jumper for the FRAM. All it does is tie /W to Vcc or /RW, depending on if you want write protection or not. If it's enabled, this means when the CPU tries to write to the FRAM, it ends up doing a read instead. So both the CPU and the RAM will be driving the DATA bus.
Is this safe or could it let the magic smoke out? It's much simpler to just disable the write line than to conditionally disable the select lines, but I don't want to blow anything up in the process.
Finally, one more RAM question. What's the real difference between the E (or CE) and G (or OE) lines? I know what the basic difference is, but I don't understand why they're separate lines. Essentially, I don't see the point of G.
I look forward to any comments, critiques, suggestions, answers, and questions you might have. (And I apologize for being so long winded. Had a lot of ideas today.)