The RUN pin and Emulation mode is muddy. It seems to be that in Emulation Mode, the MCU parrots the internal address and data bus out to the pins described.
Out of the box, in default state, the CPU runs entirely self contained. So, for example, when it's accessing internal RAM or talking to the internal ports, nothing is seen "outside" the chip.
In it default state, the 256S has 8 Parallel ports. But, as soon as you start going outside the chip, that is interfacing hardware to the assorted CPU buses rather than the ports, the majority of those start vanishing. P0, P1, P2, and P3 are consumed by the Address and Data bus. P0 and P1 are the lower 16bits of the address bus, P2 is the data bus, and P3 is 17-24 of the address bus. Unlike the '816, the '256S breaks out all 24 bits of the address bus. But at the cost of 4 of the ports.
But during Emulation mode (which is what the RUN pin governs), it seems from the documentation that when it is accessing the internal parts of the MCU, those signals are ALSO brought out to be readable on these ports.
However, it's not going to be trying to READ from those ports (notably the data bus). Of course, when it's talking to external components, it doesn't need to parrot the internal state for monitoring -- the values are there naturally.
Mind, this is just a guess, as I don't have any experience with In Circuit Emulation (ICE).
If you're not using ICE, then you can ignore the RUN pin, and that entire bit about that startup sequence. However, this is also how you enable the external ROM at startup, so it's a bit confusing. Ideally the MCU will start up with the ROM enabled, and the ROM will quickly shut down the Emulation Mode before it even starts accessing the internal memories of the system.
In truth, though the MCU is really designed to start from the internal ROM, look for an external reference (which can be a ROM, but on the 256SXB board is a Flash chip), and if it sees the signature it's looking for, it'll just short circuit to that and let it finish it continue the boot process.
It you just tie the BE/RDY pin high, it'll start up in the default mode with the internal ROM.
Now, all that said. There's your schematic.
Here's the problem with that.
I feel they did a real disservice to folks on the QXB board by dedicating Port 7 to the on board LEDs. It's all handy and nice and blinky, but the problem is that the MCU has a whole bunch of very nice Chip Select logic built it to it, and all of those Chip Select lines are on...Port 7. I think they could have "sacrificed" Port 5 for use with the blinky lights and expose the CS lines to the header. Port 5 is for the "Parallel Interface Bus" which, frankly, I'm not quite clear what that's for or how it would be used. So in MY Pooh Brain, I'd rather "lose" that than the CS logic. Exposing the CS logic would have made the QXB much more expandable.
But as is, out of the box, it's a bit of self contained island.
Now, for the RAM expansion.
In theory, tying P17 (which is A15 from the CPU), will work, since it's a /CE pin, meaning when A15 is low, the chip is enabled. And that's the case for the lower 32K of RAM (the upper 32K is dedicated to ROM).
So, that part of the decoding should work.
However, you will need to set the bit in disable P7 (the port) and then enable CS3B by hand to turn the RAM on. You'll also have to enable P0, P1, and P2 to act at the Address and Data buses. If you don't turn on CS3B, the chip won't publish the signals out to the chip. Normally, you would tie the CS03 pin to the /CE pin, so the CPU could turn it on for you. But in this case, you're using the address line directly. (This is good, that means you don't have to de-solder an LED to add the 32K of RAM.)
But it does mean that whenever you start up the board, you'll need to hop in to the monitor, and change couple of values to light up the RAM.
Were you hoping to use the ICE mode to do this? That MIGHT work, but I can't say. I really have no idea. I just speculate that you probably just don't want to do that, as it's not clear to me that it would even use those pins except when talking to the internal components.
|