HansO wrote:
I like the design and especially the IPL solution! Great for testing via crossdevelopment.
Thanks for the vote of support. I know many people on this board have discussed this solution in the past, but nothing practical as come from it yet. I do easily see that using a ROM chip is "easier" from a hardware perspective (and why not if you already have an (E)EPROM programmer?). Unfortunately, spending the $3 for the TTL-HC chips plus the cost of a straight-thru male/female 25-pin cable is still less than half the cost of even the cheapest EEPROM programmers that I've seen on the web, including many home-made units. For me, it is not a matter of convenience -- it is a matter of minimizing cost. It does complicate printed circuit board routing though.
Quote:
Do you have some source examples how to control the IPL process?
Not just yet. I only recently received the parts, and haven't build the hardware yet. I should hopefully make a start on the IPL hardware/software combination this coming week. I'm eagerly looking forward to playing with it.
Note that the software I'll be writing is for Linux, and will be written in C, because no Forth implementations for Linux are able to talk to the hardware directly. The C sources, however, should be relatively easily ported to the Windows environment, as all hardware-related functions will be abstracted into its own source file.
The theory of operation is pretty simple though. When IPLing the system, the first thing the IPLer does is use the SERDATA and SERCLK lines to fill the shift registers with all 1s. It then strobes the PUBLISH line (hooked up to STCLK inputs on the '595s) to actually make them visible outside the shift registers. Note that _OE is still negated at this point, so the 595 outputs are still in high-impedance state. This guarantees that the "state of the bus" is in a well-known state, when _OE is enabled later on.
Next, the fun begins: it needs to assert the _RES line. This obviously places the CPU into the reset state. Next, it negates the BE signal (aka asserting _PGM). This removes the 65816 from the bus completely. This is required because the 65816 will still drive the bus even while _RES is asserted. In my circuit, though, I found a rather rude surprise -- the 65816 apparently still drives the bus when BE is negated during Phi2 low. Not sure why this is -- I've verified that BE is held low on the breadboard, and I'm not seeing any noticable ripple on it.
Next, _OE is asserted, which places the 74HC595s onto the bus. Two '595s are used to drive the address bus. One drives the data bus, but does so through buffer resistors, because from what I've observed in the oscilloscope traces, the 65816 somehow still manages to drive the databus even when BE is negated. The last 595 chip only has one output -- R_W -- which because of the initialization step above, is now held in the non-destructive, 'read' state.
NOTE: For those 65816 systems that permit addressing more than 64K of memory, the unused pins on the last '595 permit addressing up to 8MB of address space.
Now that _OE is asserted, the steps to write a byte to memory are as follows:
1. Shift in the R/W byte ($00 for write).
2. Shift in the data byte.
3. Shift in A15-A8.
4. Shift in A7-A0.
5. Pulse the PUBLISH pin high briefly. That will cause all outputs to update concurrently, thus forming a new bus transaction.
6. Shift in the R/W byte ($80 for read). We need to do this to "cleanly" terminate the bus transaction, since we could be updating R/W during phi2 high!
7. Shift in the *same* data byte.
8. Shift in the *same* A15-A8.
9. Shift in the *same* A7-A0.
10. Pulse PUBLISH again.
Since Phi2 is running independently of the IPL mechanism, you'll need to make sure that the address, data, and R/W state remain valid for at least one complete Phi2 cycle. It's obviously safe to continuously write to the same RAM address. And provided the address and data lines are consistent, it *should* be OK to change the state of _OE/_WE on a RAM chip, since they are all passive logic anyway.
When you're done downloading the program to the RAM, the following steps are performed:
1. Strobe all '1's back into the shift registers, and publish it, to set it back to a known safe state (well, really, all we care about is that R/W goes back high)
2. Negate _PGM (aka assert BE).
3. Negate _RES (which should now let the microprocessor run its course while booting).
I soon hope to have timing diagrams and documentation detailing the above discussion, and maybe with a little more detail in the description given above. If you have any questions with what I've given above, though, I'd love to hear them, so I can take those into consideration when I publish the *cough* Hardware Reference Manual *cough* for the Kestrel 8K.