Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

EEPROM

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
NE5660

Bascom Member



Joined: 20 Oct 2012
Posts: 13

blank.gif
PostPosted: Fri Jun 06, 2014 4:36 pm    Post subject: EEPROM Reply with quote

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
View user's profile
Arera

Bascom Member



Joined: 23 Sep 2007
Posts: 375
Location: Wuppertal, Germany

germany.gif
PostPosted: Fri Jun 06, 2014 10:31 pm    Post subject: Reply with quote

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
View user's profile
Deanus

Bascom Member



Joined: 26 May 2006
Posts: 188
Location: Adelaide

australia.gif
PostPosted: Sat Jun 07, 2014 7:18 am    Post subject: Reply with quote

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
View user's profile
NE5660

Bascom Member



Joined: 20 Oct 2012
Posts: 13

blank.gif
PostPosted: Sat Jun 07, 2014 9:49 am    Post subject: Reply with quote

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
View user's profile
NE5660

Bascom Member



Joined: 20 Oct 2012
Posts: 13

blank.gif
PostPosted: Sat Jun 07, 2014 9:59 am    Post subject: Reply with quote

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
View user's profile
Arera

Bascom Member



Joined: 23 Sep 2007
Posts: 375
Location: Wuppertal, Germany

germany.gif
PostPosted: Sat Jun 07, 2014 10:05 am    Post subject: Reply with quote

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
View user's profile
i.dobson

Bascom Expert



Joined: 05 Jan 2006
Posts: 1534
Location: Basel, Switzerland

switzerland.gif
PostPosted: Sat Jun 07, 2014 1:15 pm    Post subject: Reply with quote

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

_________________
Home of AVRTimer, the Bascom timer value calculator.
http://www.planet-ian.com

Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum