EEPROM overused?

greencardigan

Senior Member
I'm getting errors when reading from the eeprom on my 18X. I'm wondering if I have done too many write/read cycles?

When I run this code

data 0, (255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255)

for b1 = 0 to 15
read b1, b0
sertxd (#b0, " ")
next b1

I get this in the serial terminal.

111 57 223 23 255 253 255 255 231 255 255 255 255 255 255 255

It seems that the eeprom locations from about 9 onwards are ok.
 

MartinM57

Moderator
Each EEPROM location is unlimited reads and circa 1,000,000 writes, so I doubt it!

I would use different EEPROM data to confirm - all those 255's don't really tell you what's going on

e.g.
data 0, (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)


...and what PICAXE chip? For the lower end devices, there isn't much DATA space, depending on the size of your program - see Manual 2
 
Last edited:

BCJKiwi

Senior Member
So the question is:- how often is the code WRITING to the eeprom?

In all the time that particular chip has been in use, how many writes have been made to the most used location?
 

hippy

Ex-Staff (retired)
The PICAXE-18X (16F88) Data Eeprom has a typical erase\write lifetime of 1,000,000 so it is, as MartinM57 says, unlikely that the Data Eeprom has been damaged unless there have been a lot of writes to those locations ( including in previous programs ).

Flash Memory has a typical erase\write lifetime of 100,000 so will last over a decade if you were downloading once every hour of every day during that time.

You can test what happens if you move the data to some other location -

data 100, (255,255,255,255,255,255,255,255,255,255,255,255,2 55,255,255,255)

for b1 = 100 to 115
read b1, b0
sertxd (#b0, " ")
next b1
 

greencardigan

Senior Member
I've just checked the code I've been running continuously for the last 6 month or so. I wont reveal how many writes per second I was doing. :eek: I'm guessing the eeprom was failing some time ago. :D

I have since modified my code to only write values after they change. This results in a likely maximum of 20 writes per day per storage location.

Maybe Manual1 could include the limit of 1,000,000 data writes like it does for the program memory.

Does continually writing an unchanging value (ie. stored value not changing) to eeprom affect it's life as much as continually writing a changing value?
 
Last edited:

hippy

Ex-Staff (retired)
Writing once a minute would give a lifetime of about 2 years, so I guess you were going at it more frequently than that. Once a second would drop lifetime down to about 10 days :)

20 times a day give over 100 years.

Yes, writing the same value will wear it out; the existing number is erased before the same is written again. The best solution there is to read the location to be written and don't write if it is already as it needs to be.
 

boriz

Senior Member
EEPROM is useful for storing stuff between power ups. If you want to store stuff during a run, use POKE/PEEK if you can. It uses different memory (RAM) that can last MUCH longer and is also much faster. An 18X has 93 bytes of general purpose RAM. See manual under POKE.
 
Top