barnacle wrote:
Yes, that should work - might simplify the state machine logic as well. For some reason, I never think of preloading something like a 163...
Wait, though: if you use a preloaded 163, you still only get one bit of address out of the first one in the chain because the bottom three bits are generating the write pulse. So only 32 bytes of loader with a couple of them.
Yes, this is three 4-bit counters, with an active low carry overflow /CO ... this idea is to only use three bits of the bit pulse counter, preloading %80 so there is a /CO to use as the /WR as well as the clock pulse for the address counters, and use the counter outputs as directly as possible to reduce the support chip count. So, for instance, the /CO of the high nybble is the /Set line of a /S /R flip flop, and the direct Q output of the flip-flop goes to a bit latch clocked on PHI2 driving /6502_RESET and /6502_BE, so the last write cycle can be completed before the chip launches the 1st stage bootloader.
Edit: The thing I have to still think through is allowing the SBC that it is on to use the same serial shift register to access data from the serial flash, using the SSR on CB2 of a VIA in 8-bit PHI2 clocked output (with the clock on CB1) to provide the read instruction and addressing data to the Serial Flash.
Except for the mutliplex, I think the jelly bean count is 1 USR, 1 '595 SSR, 3 up/down '193 counters, 1 74x00 NAND (two nand gates for an /S /R latch, 1 for filtering system PHI2 into a Stage1 PHI1, one for selecting the FLASH after the USR load is completed), and both sides of a 74x74 clocked d-flipflop -- one is used to create the synchronous load for the USR, the other is used to allow the final byte to be written before releasing the CPU /BE and /RESET, so eight glue logic (though note that the USR's are 20 pin ICs).
Quote:
But I suspect if you're going to have to do an OS download anyway, then the 5813 is a simpler approach although possibly a little slower. ...
My ultimate aim would be to have multiple 2nd stage images on a SerialFlash, and have the 1st stage bootloader check in a RAM location for an ID key and a RAM target address, serial flash address and number of pages to load, so that the default bootloader gives a menu of available images, pick the desired one, and then hit reset again to start it up. Part of the default 2nd stage would be a monitor and part would be the utility to load a new image into the serial flash, and the application 2nd stages would have the default 2nd stage in the magic location, so you normally just hit reset to load the default 2nd stage boot menu if you want a different application image.