View previous topic :: View next topic |
Author |
Message |
NE5660
Joined: 20 Oct 2012 Posts: 13
|
Posted: Fri Jun 06, 2014 4:36 pm Post subject: EEPROM |
|
|
HI,EVERYBODY
IN ATMEGA 128 DATASHEET Write/Erase 100,000 EEPROM
IN MY PROGRAM:
DIM A AS ERAM BYTE,B AS LONG
DO
A=3
WAITMS 5
LOOP UNTIL B=100000
END
I HAVE QUASTION:IN THIS CASE ATMEGA128 WILL DAMAGE?
(BASCOM-AVR version : 2.0.4.0 , Latest : 2.0.7.7 ) |
|
Back to top |
|
|
Arera
Joined: 23 Sep 2007 Posts: 386 Location: Wuppertal, Germany
|
Posted: Fri Jun 06, 2014 10:31 pm Post subject: |
|
|
The EEPROM is guarateed to be reliable for 100000 wr/erase cycles.
If that's your point, then you are right.
But in your sample, you assign the same value 3 for 100000 times.
I am not shure if that makes a differenz.
But if you are really going to store the same value for many times, and maybe have one different value every millionth time, than there might be a way out:
Reading the eeprom does not do any harm. So first read the eeprom, and do not write to it unless the content would change. |
|
Back to top |
|
|
Deanus
Joined: 26 May 2006 Posts: 188 Location: Adelaide
|
Posted: Sat Jun 07, 2014 7:18 am Post subject: |
|
|
Hi NE5660,
The EEprom only gets written once, A=3
Your program will loop forever, as "B" never gets incremented.
Can't really see any point to the loop unless you were attempting testing to see if the EEprom can really do 100,000 writes.
They wouldn't specify that in the data sheet if it wasn't important.
Regards
Dean |
|
Back to top |
|
|
NE5660
Joined: 20 Oct 2012 Posts: 13
|
Posted: Sat Jun 07, 2014 9:49 am Post subject: |
|
|
HI ,THANKS ALOT FOR YOUR REPLAY
IT IS EXAMPLE.I WANT TO KNOW CAN I WRITE EEPROM VARIABLE FOR MORE THAN 100000 TIMES.
Last edited by NE5660 on Sat Jun 07, 2014 10:02 am; edited 1 time in total |
|
Back to top |
|
|
NE5660
Joined: 20 Oct 2012 Posts: 13
|
Posted: Sat Jun 07, 2014 9:59 am Post subject: |
|
|
HI,I AM SORRY.I FORGOT INCREASE B
DIM A AS ERAM BYTE,B AS LONG
B=0
DO
A=3
WAITMS 5
INCR B
LOOP UNTIL B=120000
END
I WANT TO KNOW,CAN I WRITE MOR THAN 100000 TIMES IN EEPROM VARIABLE SUCH AS A? |
|
Back to top |
|
|
Arera
Joined: 23 Sep 2007 Posts: 386 Location: Wuppertal, Germany
|
Posted: Sat Jun 07, 2014 10:05 am Post subject: |
|
|
No, because you leave the loop after 100.000 cycles! There is no real difference compared to your first post, all aswers apply the same.
I guess you need to save values in cade of a powerdown? |
|
Back to top |
|
|
i.dobson
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
|
Posted: Sat Jun 07, 2014 1:15 pm Post subject: |
|
|
Hi,
I've done tests and in my tests the AVR eeprom lasted atleast 150K writes.
I used code similar to this:
Code: |
dim A as byte
dim B as Byte
dim w as dword
do
incr B
incr w
Writeeeprom b , 10
print w
Readeeprom A, 10
if A <> B then
print "Write error"
do : loop
endif
Loop
|
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
|
|