Go Down

Topic: EEPROM not always reliable (Read 784 times) previous topic - next topic


I have been playing around with the functions eeprom_write_byte and eeprom_read_byte, for writing and reading the nonvolatile 512 bytes of EEPROM on the Atmega8.  I had stored an ASCII string in this memory, and I had a command to retrieve the contents of this string and play it in Morse Code.  For several days, I had used this command to play the string without any problem.  Then, this morning, the second byte in the string got corrupted, though all the other bytes were still correct.  Like an idiot, I overwrote the string with a new string without determining what the corrupt byte's value had become.  I just know it was corrupt because my Morse Code algorithm treated that character as a space by delaying for a while, as it does for any character it does not recognize.  (If this happens again, I will add code to determine what the corrupt bit pattern is.)

My question is, has anyone else encountered erratic EEPROM behavior like this?


- Don


OK, I just had the same thing happen again, this time to very first byte in EEPROM (address 0).  I definitely had the character 'l' (lowercase 'L', ascii value 0x6c) stored there.  The first few times I retrieved it, I got the correct value back.  But then all of a sudden, it got corrupted.  I added special code this time to figure out what the value was, and it was 255 (or 0xff if you prefer).

Any ideas why my EEPROM is getting overwritten at random times?

Go Up