Eprom disaster

Not really a question more bit of advice for any noobs such as my self on using the Eprom.

Make sure you check that you put the Eprom write in the correct place. After a lot of head scratching and nearly working code i realised i had the Eprom write in the wrong place. The upshot of that was that every time i tested the sketch it was writing to the Eprom in a loop. It should have been when i pressed a button but due to tiredness i got it wrong and knackered the Eprom on two Mega's. I will have now leave that part of the code until i get a new Mega. The rest of the board still works ok but the Eproms after having god knows how many writes to then have gone.

So double double check your code before you test it when using the Eprom.

Q: are all locations of the EEPROM affected or only the part used in the sketch?

You can still use external I2C eeprom / spi eeprom - add that to your Mega boards and they are up and running again, maybe not as fast but it works very well. you might need to reimplement your eeprom calls like in - http://arduino.cc/playground/Main/LibraryForI2CEEPROM -

It is a pity you don't know how many writes it were as it is asked many times on the forum.

Ahh thanks yes that's useful stuff to know. Unfortunately i have no way of knowing how many times and of the cells were written. It didn't take long to goose them some of the cells seem ok but not enough of it to be usable and the Arduino doesn't like reading them at all it locks up when it tries. All i can say is a lot as every time the code called the function to scan the buttons it was also writing a collection of about 11 bytes. Strangely even though this was at the same location in the eprom for most of them when it fried it seemed to alter the whole eprom. ( I am saving 64 present setting's of 11 bytes each )

The reason i'm not using PROGMEM is that while they are being created i have a bunch of pots attached to set them up.

Does anybody know if the Adafruit Wave shield (which i have running on a uno attached to the mega via a serial connection) wil allow me to save to the SD card or is it just for playing audio? I've had a look but couldn't find anything. That could temporarily solve the problem as i could transfer them to the UNO/SD card and then to the mega eprom at a later date. Cheaper than buying a eprom chip as i already have the Wave shield.

wil allow me to save to the SD card

Yes you can, just use the SD library.

That could temporarily solve the problem as i could transfer them to the UNO/SD card and then to the mega eprom at a later date

Be aware that SD cards use flash memory and this has a capacity of 100 to 10000 times less writes than EEPROM.

Don't you mean eeprom? They are two total different things eprom is usually accessed parallel and has a uv erase window and eeprom is what is built in to many microprocessors and is available in both parallel and serial eeprom is electronically erasable meaning it can be overwritten many times without any uv light or other stuff were as eprom needs to be erased with an uv light and you can not overwrite anything without erasing the whole thing.

ahh yes i mean the one built into the microcontroller. I didn't know there was a difference. The thing i seem to have broke is built in to the chip. I assumed there was a tiny UV light in there or something.

Now i think about it that sounds ridicules. I didn’t bother my self with the particulars of that but it’s good to know the difference cheers.

The extra E in EEPROM stands for Electrically so Electrically Erasable Programmable Read Only Memory No tiny UV lights needed.