I think this is probably well beyond my knowledge right now, but is it feasible to use the Arduino to emulate an 27 series EPROM?
Having done a bit of research there are boards out there that interface over serial, that use SRAM or similar to hold the data and emulate an EPROM. My thought: Why not use Arduino?
Specifically what I want to do is create an Atari 2600 cart in which the ROM is replaced by an Arduino doing the IO of data. It would work by sending binary data over serial to the Arduino which is connected to the cart where the mask ROM or EPROM would be, then when the 2600 is turned on, it addresses the cart and the Arduino passes data to and from the 2600 as an mask ROM / EPROM would.
Then perhaps add in a control interface and an SD card with multiple ROMs. Hey presto: Multicart!
From memory the maximum size of these carts are 8kb without bank switching and the 27 series EPROMs are the ones that are compatible with the board.
Also, using an EPROM, I want to be able to load, wipe and reload easily.
Somebody used to make a low cost EPROM eraser I think it was called "datarace" or "dataerase", but I'm not sure of the spelling and I can't find it online at the moment (probably no longer made...). I found an eraser for $60 USD. Or, you should be able to find a used one. Or, you might be able to make one easily if you can find the right bulb (UVC ?) and a lamp/fixture with a similar flourscent bulb to put the UV bulb in.
Oh... You need a true EPROM. There are OTP (one time programmable) EPROMs, which are the same device without the window for UV erasing.
A better option would be a FLASH chip (electrically erasable nonvolitle memory). You should be able to find a FLASH chip with the same (8-bit) data bus, and the same or more number of address lines. You'd also need the same voltage (5V) and the same (or higher) speed. It should work electrically, but it will probably have different pinouts, so it's unlikely to work in the same board/socket as the EPROM .
Now, the only problem is programming the thing. If you have a FLASH/EPROM programmer, you can simply read the EPROM into the programmer, switch the programmer's device settings, and program the FLASH with the same data.
I suppose you could build a programmer with the Ardudino... You'd just have to study-up on how to program/read these devices, and you'd need to make the connections (address bus/data bus read/write/enable, etc.), and write some code.
This is a simple emulating project, I had a similar device on the market in the 90s.
A single 512k SRAM will emulate 64 of the original EPROMs, add three 8-bit bus transceivers, an AVR micro (Arduino) and an SD card and you're away. Maybe add a battery backup for the SRAM or just reload off the SD every power up.
Crossroad's 1284 board would have enough IO for this and it has an SD interface.
The pinout of the SRAM chip doesn't matter.
I reckon $20 in active parts + hardware + the Ardiuno board.
You could load/wipe etc instantly using the Arduino and also have programs available from the SD when a PC is not around.
Map out the steps you need to get to the point where the SRAM acting as EPROM will be accessed by your Atari,
work backwards from there to define the pieces needed.
You will find things like you need to access the SRAM from 2 places, you will need to access the SD card from Arduino to load the SRAM, you will need to make files to put on the SD card (arduino receives those serially from PC and loads the card?), you will need a way to select the program to download into the SRAM (software from PC command, switch selection?).
All those kinds of things need to be defined. That's engineering.
Googling EPROM emulator was my starting point. Having never even programmed an EPROM in my life, having only an overview of what they are, and nothing of the nitty-gritty of their functionality, I'll put this down as "one for the future".
However, did see this on Hack-A-Day. Seems they're using a W27C512-45, programmed over serial.
Could potentially be done with an Arudino and SD card, no? Select the file with a couple of push buttons and a 1602 inside the cart.
It doesn't matter what memory technology you use (unless you get into dual-ported memory) you still have all the same issues of accessing the chip from two places, ie the Atari and the programming gadget (Arduino). It's an easy problem to deal with but deal with you must.
An EEPROM does solve the volatility issue if you don't want to reload from the SD on power up.
OK, just thinking about the dual porting issue, if you are happy to only program while the cart is NOT plugged in you don't have a problem, pull it out to program, plug it in to play.
Graynomad:
OK, just thinking about the dual porting issue, if you are happy to only program while the cart is NOT plugged in you don't have a problem, pull it out to program, plug it in to play.
Yeah, that's fine. An EEPROM and a ribbon cable out would be perfect.
How would I program the EEPROM though? Over serial? Using Arduino?
That W27C512 chip looks like a right PITA to program, you need 12v, 14v and 5v, I'd say it's real old technology (the data sheet is 1999). There would be better chips to use these days, maybe flash or RAM or a better EEPROM.
My personal choice would probably be RAM but that's because I don't know much about the others. If you are happy to load from an SD every power up that's the easiest I think.
How would I program the EEPROM though?
You could just buy a commercial programer, that's probably the easiest way.
It's been five or so years and my knowledge has moved on a lot, so now ready to tackle this challenge!
Thinking about this more I'm wondering if I could use a Mega 2560 to emulate an entire cart (rather than using it to program an external Flash or NVRAM chip). There are a few reasons for this:
Fewer components.
To deal with bank switching that many Atari 2600 games use.
A similar commercially available cart (Harmony Cart) uses an ARM7 and that seems like a neat solution.
My concern now is: Would the ATMEGA2560 at 16MHz be fast enough to deal with requests from the 6507 in the Atari 2600 running at 1.19MHz? How would I go about calculating that?
I broke out the logic analyzer and wrote a sketch on a Duemilanove to just pull a pin high and low against a clock and got a frequency 55.56kHz which I'm assuming is too slow of a response time.
willmp:
I broke out the logic analyzer and wrote a sketch on a Duemilanove to just pull a pin high and low against a clock and got a frequency 55.56kHz which I'm assuming is too slow of a response time.
Wow.. I thought it would be way closer than this.. I was hoping to do the same thing, without the trouble of dealing with the dual access to the EEPROM, by emulating the memory access through arduino software, but I guess if 55khz is all I'm gonna get, that's at least 20x too slow.. Bummer!
Glad you tested that though - Thanks.. I dont have the tools to do the test you did!
-Steve
In the 80s I built my own EPROM cartridge for an Atari 600/800XL, holding a FORTH system
I'd think that a Mega can emulate an (EP)ROM much faster than 55kHz. What's required are (low level) port read/write operations, triggered by the CE and OE signal(s). If the emulator has nothing else to do, it can poll the address lines permanently and retrieve the related data byte from its own memory and store it in the data port. Then, when OE goes low, the data port is made output and if OE goes high again it's made input (tri state) again. If this still is too slow, an 8-bit parallel register with tri-state outputs (SN74x373) can be added, so that the OE signal connects directly to its OE pin.
Any kind of Arduino memory can be used, with SRAM used as a fast buffer memory for slow (EEPROM, I2C, SD...) bulk memory. Here the Mega (2561) has much more SRAM and I/O ports available than an Uno (328) has.
The Mega also has an interface for parallel (27x) memory with a multiplexed address bus, which can be used to read data from a 27x EPROM for storage e.g. on SD card or PC. It's not designed for memory emulation, though, and may require an additional address latch.