Parallel Flash Programmer, what am I doing wrong?

Hey All,

I’m attempting to use a Mega 2650 as a programmer for a SST 39F010 1M Flash ROM. This ROM uses special software protection commands to allow for programming, erasing, and reading the chip ID in the form of a sequence of bytes written to the device.

I’ve written the sketch below to test programming with just a few bytes of sample data, but the data will not stick, nor can I read a valid Device ID from the chip. I just get the value of the last data I attempted to send to the chip back for any address. For example, if the last byte I tried to write to the device is 0xAA, I get 0xAA back when I attempt to read from any address until I write another byte to the data port.

I’ve triple checked my wiring, and swapped out different ICs, so my programming must be at fault.

For speed, I’m using the A (address msb), C (address lsb), and F (data in/out) port registers.

The datasheet for the ROM is here.

What am I doing wrong?

flash_programmer.ino (3.75 KB)