Hello, i'm in progress of programming 27c800 eprom with an arduino mega 2560, this is also my first successful attempt at direct port manipulation and device implementation from scratch, using only datasheets. i've not yet made the sketch to program but i can successfully read the whole rom and dump it to the serial port, so i wanted to share to anyone who wants to give it a try! using this sketch, you can also read Amiga mask roms, and should be able to read other 27cxxx EPROMs. The speed is around 12Kb/s.
To hookup the eprom to arduino mega, no other components are required, just tie the following pins to corresponding pins and ports on mega using jumpers(lots of);
A0-A7 goes to PORTC,
A8-A15 goes to PORTA,
A16-A18 goes to PORTG,
Q0-Q7 goes to PORTK,
Q8-Q15 goes to PORTF,
E pin goes to D3,
G pin goes to D2,
VSS pins go to Ground,
VCC, BYTEVpp pins go to +5V,
NC pin is not connected.
Start up a terminal window, i use RealTerm to be able to display response directly in HEX format, record incoming data(to dump the rom to a binary file) and send the rom i want to program in the future. Send any byte, when the arduino receives a byte, it sends the 16-bit words from addresses 0 to 524288 in raw format.
In 27c800, address port is 19 bits wide, so it takes 2 8-bit port and 1 3-bit port of arduino mega. the address is chopped into parts using bitwise OR operations and written to port registers. After writing the address registers, the chip enable pin "E" is set low and mcu waits 1us, then sets the output enable "G" pin low and mcu waits another 1us, then the 16-bit word at the requested address is available at A0-A15 pins. The data is read as two bytes and put into an array, then written to the serial port. This goes until the address is 524288(which is 8mbit for a 16-bit per word configuration).
To read other eproms with their correct sizes, you should change the max address count in the while condition. You can also read roms other than 8mbit directly with this exact code, but the data will repeat itself for smaller roms since upper address bits will have no meaning for the eprom, or you will read the bigger roms incompletely.
I also have the sketch to read a specific address, i can post it here if you want to.
long addressCounter = 0;
byte readWord[2] = {0, 0};
void setup() {
DDRC = B11111111;
DDRK = B00000000;
DDRA = B11111111;
DDRF = B00000000;
DDRG = B11111111;
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
Serial.begin(115200);
digitalWrite(3, HIGH);
digitalWrite(2, HIGH);
}
void loop() {
if (Serial.available() > 0) {
while (addressCounter != 524288) {
PORTG = (addressCounter & 458752) >> 16;
PORTA = (addressCounter & 65280) >> 8;
PORTC = addressCounter & 255;
digitalWrite(3, LOW);
delayMicroseconds(1);
digitalWrite(2, LOW);
delayMicroseconds(1);
readWord[0] = PINK;
readWord[1] = PINF;
Serial.write(readWord, 2);
digitalWrite(3, HIGH);
digitalWrite(2, HIGH);
addressCounter++;
}
}
}