The first attempt used a parallel eeprom - basically Grant's design with a couple of minor changes - and worked well but required the eeprom removing and reprogramming every time the code changed... the SBC works fine but the pins on the eeprom can take a battering, and it required me to build an eeprom programmer (nucleo, some ram, and a zip socket) and write two lots of software to get the code in - one lot for the nucleo and one for the programmer running under linux. It works, but lacks elegance.
The most recent attempt was the Neolithic Romless in which the code du jour in hex file form is massaged into a binary format and squirted over a serial link - the same link being used later for normal serial comms. The only three disadvantages I can think of at the moment are (a) it's volatile, so you have to reload the code at every re-power; (b) it lacks a way to reset the processor without it dropping into reload mode; and (c) ideally any code running should wait for a wake-up character from the terminal to avoid any early characters being missed.
So here's another thought... an SPI serial eeprom or flash could be programmed in-circuit (isolated by resistors perhaps) using a simple programmer - there are lots available on ebay, or e.g. an arduino or a nucleo could be used. Obviously the 6502 can't execute in place from an SPI memory, but a similar approach might be used to the Neolithic Romless and output a serial stream to a serial shift register, with a counter to maintain the address...
- The command code for a 'read' on every SPI memory I've come across is 0x03, sent high bit first, followed by two address bytes. The fourth byte is the memory read at that location, and if the chip select is kept low, it will autoincrement and read forever, irrespective of the data sent.
- Generating that 0x03 is simply an AND of the bits Q1 and Q2 of a counter driven by the CLK signal; this produces the necessary two bits every eight clocks.
- If the next two bits Q3 and Q4 are NORed together, and that output is ANDed with Q1 and Q2, then an output 0x03, 0x00, 0x00, 0x00 is repeated ad nauseam. (Cycles 0, 1, 2, 3).
- The output data from the SPI is valid starting at cycle 3 - assuming that the device is 64kB or less - and can be clocked into a suitable serial shift register. The time to generate a write pulse would be in the first half clock of each cycle; after that the address counter can be incremented.
- The address counter needs to initially reset, and stay reset until cycle 3, after which it can increment at CLK/8. A sufficiently high count (power of 2, so say A14 rising for a 16kB transfer) can be used to disable the counter, and to enable the processor
I still need to think about the timings involved, but I suspect this is a five or six chip solution.
Thoughts?
Neil