wondras said:All the pieces are in the Atari schematics and the ER2055 datasheet, it just takes a little puzzling to fit them together. Fortnately, Atari used the same interface hardware for it in every game I've looked at. It appears to the CPU as three memory addresses:
- EAADDR (also called EAWRITE) is a base address plus a six-bit offset. Writing to it sets a latch that holds the EAROM's address lines to select which of the 64 bytes you want to read or write. It also latches the data bus, which is used for write operations.
- EACONTROL is a latch that sets the state of the EAROM's chip select, clock, and two control pins that select READ, ERASE, or WRITE mode. (An ERASE is required before you can WRITE.)
- EAREAD enables a buffer that puts the EAROM data on the CPU bus
The datasheet gives the exact steps and timings, but basically you:
[list type=decimal][*]Set the address and data by writing to EAADDR[*]Activate the EAROM in the correct mode by writing to EACONTROL. [*]For reads, use EACONTROL to send a clock pulse, then get the data by reading from EAREAD.[*]Set the chip back to idle via EACONTROL.[/list type=decimal]
Doing this remotely via serial commands might be an issue. Erase and write cycles are supposed to be 50-200 milliseconds, and I'm not sure how fussy it is about this. (I suspect Atari used the NMI timer to get such long delays without blocking the on-screen activity.) Reading should be fine, though; you can get the data anywhere from 2 microseconds to 30 seconds after the clock pulse.)
It's also worth mentioning that the EAROM is only rated for 1 million writes total, so it's good to avoid unnecessary writes.
I'll let you know when the code for it is available. You could probably just wrap the ER2055::read() and write() functions as new serial commands.
Thanks for that!
I'm sure we'll need specialized methods like this from time to time as it won't be realistic to do it remotely. I assume you already wrote the code to do the above? If not, I'll take a look at doing that.