Hello everyone,
I am having one device whose purpose is to monitor AC voltage and send it on cloud.
In this device I have a device ID which we store in EEPROM at the beginning of installation.
This EEPROM is only then read as it doesn't have writing operation unless the key kept pressed for 3 seconds.
in my 100 devices 2-3 devices where found whose EEPROM has got corrupt / stored garbage value and changed its device ID on random.
I know if the power supply is bad while writing the EEPROM the storage may store garbage value, but is there any possible moment where stored EEPROM may get hanged or holds garbage without write cycle.
Can a voltage spike on IO or analog pin could cause EEPROM corruption or can a vcc voltage fluctuation can result in EEPROM corruption even though we are not in writing cycle?
It may not be possible, As the EEPROM was giving right id over few days. and then after some days it started showing wrong data.
This issue is also not very repeatable so it becomes difficult to simulate or do trial and error attempts.
IIRC, when EEPROM begins to fail due to excessive writes, one of the characteristic symptoms is unpredictable readout - sometimes correct, sometimes incorrect. The symptom may exhibit more or less frequently, depending on voltage, temperature, and quite possibly other criteria I've forgotten. The device doesn't count down 100000 writes, and suddenly stop talking, it is by it's very nature unpredictable.
So yes, it's possible you've got a bad memory - maybe you had a runaway development code error, or maybe you've purchased a clone Arduino with a faulty chip, or maybe something else has happened; it's impossible for us to tell.
It's also possible you've got poor voltage regulation on your Arduino, with excess or low input voltage, or excess current draw by peripherals, resulting in less than ideal voltage conditions for the processor causing bad reads - but if they read faulty in a post-mortem, that's unlikely. Again, no schematic, so no help possible.
I recently did a test to find out how many times I could write to one particular EEPROM address before it failed.
Each second I wrote 01010101 to the chosen address, read it back, checked whether it was correct and then wrote 10101010 to that address, read it back and checked for correctness. I arranged for the test to stop at the first failure.
I set the test going and it was not until 63 days later after 5345583 of these write/read cycles that I got a failure. Far higher than the specified life of 100,000 write/erase cycles.
Obviously this is only a sample of 1, and there will be wide variations in the number of writes that can be performed before a failure occurs.
I suggest that you post your code, (using the < code > tag of the toolbar), so that we can understand if there is any flaw in your code, and thus be able to help you better.