ten times the Microchip defined life for 24LC256 . . .This sounds interesting!
I'm going with 10,000,000 not sure why!
but certainly not to say it cannot last longer. The 10^6 wrie cycle life would be seen as a guaranteed minimum though you could have a task proving it failed before that in a warranty claim.Features
• Low-power CMOS technology:
- Maximum write current 3 mA at 5.5V
- Maximum read current 400 μA at 5.5V
- Standby current 100 nA typical at 5.5V
• 2-wire serial interface bus, I2C™ compatible
• Cascadable for up to eight devices
• Self-timed erase/write cycle
• 64-byte Page Write mode available
• 5 ms max. write cycle time
• Hardware write-protect for entire array
• Output slope control to eliminate ground bounce
• Schmitt Trigger inputs for noise suppression
• 1,000,000 erase/write cycles
• Electrostatic discharge protection > 4000V
• Data retention > 200 years
D124 TREF Number of Total Erase/Write Cycles before Refresh (4) min =1M typ =10M max= n/a — E/W -40°C≤TA≤+85°C
But is it ? I honestly don't know and haven't looked at the datasheet but there can be clever tricks such as being able to set bits low without erasing the byte affected. Unless the datasheet deigns to tell us exactly how things are implemented we may never know.I writing to location 0 only, but obviously a whole page is written each time.
Refer: http://www.microchip.com/stellent/groups/SiteComm_sg/documents/Training_Tutorials/en532276.pdf, since virtually all EEPROMs include an automatic erase step before programming.
Since E2s can be programmed down to the byte level, an erase/write cycle could be for as little as one byte to as much as a full page.
We will see later how these different write modes have an effect on endurance
andThe second key effect on endurance is the choice of write mode. When a single byte is programmed, the energy from the
charge pump is concentrated on that one byte. If a page write is used, that energy is dissipated over more bytes, so cell wear
is decreased. Microchip builds in circuitry to minimize the wear effect of byte writes, but overall, designers should use Page mode
whenever possible
More information on Endurance
1. AN 1019 : Endurance Tutorial
2. AN 562 : Using Total Endurance S/W
I knew about that trick years ago with UV erasable EPROMs, where you could 'write' without 'erase', but only if bits were going low.... there can be clever tricks such as being able to set bits low without erasing the byte affected. ...
Is this mode selection controlled by the PICAXE firmware ?The second key effect on endurance is the choice of write mode. When a single byte is programmed, the energy from the
charge pump is concentrated on that one byte. If a page write is used, that energy is dissipated over more bytes, so cell wear
is decreased. Microchip builds in circuitry to minimize the wear effect of byte writes, but overall, designers should use
Page mode whenever possible.
The buffer size is 64 for a 24LC256.Note: One of the biggest mistakes made by beginners is that they don’t realise that page writes can only ‘start’ at a multiple of the buffer size, and cannot overflow the page buffer size. In effect this means (for an 8 byte buffer) you can write 8 bytes up from address 0 (or 8 or 16 etc.) but only up 6 bytes from address 2 (10, 18 etc.), or else you would overflow the 8 byte page write boundary.
Nothing stating that one must start at a specific point. Only ensure you do not try to cross a page boundary.6.2 Page Write
The write control byte, word address and the first data byte are transmitted to the 24XX256 in much the same
way as in a byte write. The exception is that instead of generating a Stop condition, the master transmits up to
63 additional bytes, which are temporarily stored in the on-chip page buffer, and will be written into memory
once the master has transmitted a Stop conditi
1h 20min is a million counts, you are a bit late, it's just passed 3 million !My guess is 1hr 22mins, now I'm going to read the post and see what the outcome is/was.
I know, so now I'm going to 6-Million as my second guess.1h 20min is a million counts, you are a bit late, it's just passed 3 million !
So how are you checking to see if it's failed? (Just curious!)
' Interrupt
' ---------
interrupt:
' Generate another interrupt at next overflow
' -------------------------------------------
timer = 0xffff
toflag = 0
' Count writes
' ------------
inc ecount_low
if ecount_low > 9999 then
ecount_low = 0
inc ecount_hi
endif
' Test that this read = last write
hi2cin 0, (rd_val)
if rd_val <> wr_val then
inc failed
fr = rd_val
fw = wr_val
endif
' Write new value
wr_val = randwrd
hi2cout 0, (wr_val)
' Count time
' ----------
inc ms_count ' Count up in 5mS increments
if ms_count > 199 then
ms_count = 0
inc sec_cnt
if sec_cnt > 59 then
sec_cnt = 0
inc min_cnt
if min_cnt > 59 then
min_cnt = 0
inc hrs_cnt
if hrs_cnt > 23 then
hrs_cnt = 0
inc day_cnt
endif
endif
endif
endif
That's a good thing! We need numbers at 3.3 and 5V. Christmas is fine!Bugger, I've just realised I'm running this all at 3.3v, it will last till Christmas at this rate !
Good Morning,Isn't it about now that you realise you have a bug in your code?
#PICAXE 28X2
#NO_TABLE
#NO_DATA
sertxd ("EEPROM Test",cr,lf)
' Inputs
' ------
symbol pbStart = b.4 ' Start
' Outputs
' -------
symbol ledIntActive = c.0 ' Interrupt activity indicator
symbol ledLoopActive = c.1 ' Main loop activity indicator
symbol Hz200 = c.2 ' 200 Hz output
; hserout = c.6
' hserin = c.7
' hi2c scl = c.3
' hi2c sda = c.4
' Variables
' ---------
symbol wr_val = b0
symbol rd_val = b1
symbol ee_val = b2
symbol ms_count = w2 ' Millisecond count ( b4,b5 )
symbol sec_cnt = b6 ' Seconds count
symbol min_cnt = b7 ' Minutes count
symbol hrs_cnt = b8 ' Hours count
symbol main_cnt = b9 ' Main loop count
symbol sec_old = b10 ' Seconds memory
symbol day_cnt = w6 ' Days count
symbol randwrd = w7
symbol failed = w8
symbol ecount_low = w9
symbol ecount_hi = w10
symbol fr = w11
symbol fw = w12
' Code starts here
' ================
setfreq em64 ' Run at 64MHz
pause 10
hsersetup B115200_64, 2 ' Set serial TX parameters
pause 10
hi2csetup i2cmaster, %10100000, i2cfast_64, i2cword
pause 10
restaart:
setintflags %00000000,%00000000 ' Stop interrupting on timer overflow
ms_count = 0
sec_cnt = 0
min_cnt = 0
hrs_cnt = 0
day_cnt = 0
failed = $FFFF
ecount_hi = 110
pause 2000
hserout 0,(13,10,"EEPROM Test",13,10) ' Say hello
pause 2000
settimer 64286 ' Set timer preload value
timer = 0xffff ' Generate interrupt at next overflow
toflag = 0 ' Clear timer flag
setintflags %10000000,%10000000 ' Interrupt on timer overflow
Do 'Main_loop:
' Main loop activity indicator
' ----------------------------
inc main_cnt ' Toggle main loop activity indicator every 200 cycles
if main_cnt > 200 then
main_cnt = 0
toggle ledLoopActive
endif
' Make random
' -----------
random randwrd
' Interrupt activity indicator
' ----------------------------
if ms_count > 100 then' Toggle interrupt activity indicator every 500mS
high ledIntActive
else
low ledIntActive
endif
' Print status every second
' -------------------------
if sec_old <> sec_cnt then
sec_old = sec_cnt
gosub TXtimers
hserout 0, (" ",#ecount_hi)
pause 5
hserout 0, ("0,000")
pause 5
hserout 0,(" F=",#failed)
pause 5
hserout 0, ( " fw=",#fw," fr=",#fr)
pause 5
hserout 0,(cr,lf)
endif
Loop ' End of Main_loop
' ==============================================================================================
' ==============================================================================================
' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
' Interrupt
' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
' Interrupt
' ---------
interrupt:
' Generate another interrupt at next overflow
' -------------------------------------------
timer = 0xffff
toflag = 0
' Count writes
' ------------
inc ecount_low
if ecount_low > 9999 then
ecount_low = 0
inc ecount_hi
endif
' Test that this read = last write
hi2cin 0, (rd_val)
if rd_val <> wr_val then
inc failed
fr = rd_val
fw = wr_val
endif
' Write new value
wr_val = randwrd
hi2cout 0, (wr_val)
' Count time
' ----------
inc ms_count ' Count up in 5mS increments
if ms_count > 199 then
ms_count = 0
inc sec_cnt
if sec_cnt > 59 then
sec_cnt = 0
inc min_cnt
if min_cnt > 59 then
min_cnt = 0
inc hrs_cnt
if hrs_cnt > 23 then
hrs_cnt = 0
inc day_cnt
endif
endif
endif
endif
setintflags %10000000,%10000000 ' Interrupt on timer overflow
return ' Return from interrupt
' ==============================================================================================
' ==============================================================================================
' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
' Subroutines
' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TXtimers:
' TX time
if day_cnt < 100 then : hserout 0,("0") : endif
if day_cnt < 10 then : hserout 0,("0") : endif
hserout 0,(#day_cnt,":")
if hrs_cnt < 10 then : hserout 0,("0") : endif
hserout 0,(#hrs_cnt,":")
if min_cnt < 10 then : hserout 0,("0") : endif
hserout 0,(#min_cnt,":")
if sec_cnt < 10 then : hserout 0,("0") : endif
hserout 0,(#sec_cnt)
return
#PICAXE 28X2
#NO_TABLE
#NO_DATA
pause 1000
sertxd (cr, lf, "EEPROM Test 2",cr,lf)
pause 100
hi2csetup i2cmaster, %10100000, i2cfast_8, i2cword
pause 100
hi2cout 0, (11)
pause 10
hi2cin 0, (b0)
pause 10
sertxd (#b0,cr,lf)
pause 10
hi2cout 0, (22)
pause 10
hi2cin 0, (b0)
pause 10
sertxd (#b0,cr,lf)
pause 10
hi2cout 0, (33)
pause 10
hi2cin 0, (b0)
pause 10
sertxd (#b0,cr,lf)
pause 10
hi2cout 0, (44)
pause 10
hi2cin 0, (b0)
pause 10
sertxd (#b0,cr,lf)
pause 10
hi2cout 0, (55)
pause 10
hi2cin 0, (b0)
pause 10
sertxd (#b0,cr,lf)
pause 10
hi2cout 0, (66)
pause 10
hi2cin 0, (b0)
pause 10
sertxd (#b0,cr,lf)
pause 10
hi2cout 0, (77)
pause 10
hi2cin 0, (b0)
pause 10
sertxd (#b0,cr,lf)
pause 10
hi2cout 0, (88)
pause 10
hi2cin 0, (b0)
pause 10
sertxd (#b0,cr,lf)
pause 10