Here's a first cut at a circuit diagram; it still needs some odds and ends tidying up, but any input before then is appreciated.
- DMA.pdf
- (358.46 KiB) Downloaded 21 times
The idea is that when the processor writes to the DMASTART address, it triggers U5 which starts the cycle; the counters U6,7,8 count to 512 and then reset. During this time, the 65c02 is halted with BE holding the bus three-stated. U10 and 11 switch the counter output and the top seven bits of U9 - latched from the data bus when DMASTART was written - to the memory address bus to give the target address.
At the same time, the CF address is tied to zero, and it's ~RD and ~WR input are replace with a locally generated signal - ICs 1,3, and 4 and a modified signal replaces system R/~W.
Before starting the DMA, the processor writes the LBA to the CF, starts the transfer, and waits until the CF is ready to transfer. Then it writes the DMASTART; the low bit of the page address defines whether this is a CF-RAM or RAM-CF transfer.
For writes to the CF, R/~W stays high to read memory, and ~WR pulses once per clock to force the CF write. ~RD stays high. To read, ~WR stays high and R/~W pulses low once per clock, along with ~RD. I _think_ that gives me a valid transfer time at 1.8MHz; the data appears some time after ~RD goes low and is written to RAM on the rising edge.
At the end of the transfer, the timers stop, the flip-flop resets, BE is raised and RDY deasserted. The processor starts and has the data available from the next instruction.
I hope...
Neil