Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

read of flash memory

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 939
Location: France

france.gif
PostPosted: Fri Feb 06, 2015 5:23 pm    Post subject: read of flash memory Reply with quote

Hello,
The datasheet of a Atmega 328 (arduino type) say Write/Erase Cycles: 10,000 Flash/100,000 EEPROM but nothing about the read cycle.

I have to write some bytes in the EEprom (2 times a year), but I have to read them every seconds

I have 2 questions :
A) How many times to read 2 bytes in EEprom with 16Mhz crystal (approx ?)
B) Is the fact to read EEprom affect the live of EEprom ?

Many thanks for you answers

JP :wink:

(BASCOM-AVR version : 2.0.7.8 )
Back to top
View user's profile Visit poster's website
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 1827

blank.gif
PostPosted: Fri Feb 06, 2015 5:55 pm    Post subject: Re: read of flash memory Reply with quote

Duval JP wrote:
A) How many times to read 2 bytes in EEprom with 16Mhz crystal (approx ?)

Till the end of days. Or at least the 20 years which are guaranteed by the datasheet for data retention.
Quote:
Is the fact to read EEprom affect the live of EEprom ?

No. Reading doesn't change anything, writing does. The amount of changes is what kills the cells.
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 939
Location: France

france.gif
PostPosted: Fri Feb 06, 2015 6:22 pm    Post subject: Reply with quote

thanks for the second answers.

But I did an error in ma first question. I meant : How long does it take to read a eeprom byte ?

JP
Back to top
View user's profile Visit poster's website
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 1827

blank.gif
PostPosted: Fri Feb 06, 2015 6:57 pm    Post subject: Reply with quote

Duval JP wrote:
But I did an error in ma first question. I meant : How long does it take to read a eeprom byte ?

Datasheet:
Quote:
When the EEPROM is read, the CPU is halted for four clock cycles before the next instruction is executed.

How many cycles it takes to enter and exit Bascom's EEProm routines, you should be able to check in the simulator.
But there is no additional (3.6 ms) delay similar to writing the EEProm.
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 939
Location: France

france.gif
PostPosted: Fri Feb 06, 2015 7:42 pm    Post subject: Reply with quote

many thanks , very fast ! very GOOD
Back to top
View user's profile Visit poster's website
Arera

Bascom Member



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

germany.gif
PostPosted: Sat Feb 07, 2015 1:46 pm    Post subject: Reply with quote

maybe it's faster to copy the eeprom byte to RAM at powerup, and after changing the content. Then use the RAM.
You could even easily do calculations on the RAM-byte, and afterwards copy it back to the EEPROM.
The EEPROM is only a store, not a "workspace" (cannot find a more suitable word here...).
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 939
Location: France

france.gif
PostPosted: Sat Feb 07, 2015 5:07 pm    Post subject: Reply with quote

Thank you for your comment, but I have to go through this reading eeprom every second. I do a clock and I need to know if I am "summer time" or "winter time" for changing bi-annual hour.
I use a RTC with battery backup but this parameter is not saved and I'm afraid by mains power failure.

I write the program and it works, I write the flag only 2 times/year so no problem: 100000/2 =50000 years! Wink

Encore merci
JP
Back to top
View user's profile Visit poster's website
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 695

poland.gif
PostPosted: Sat Feb 07, 2015 10:32 pm    Post subject: Reply with quote

Only for info and example. Some RTC like PCF8583 have free unused 240 bytes RAM and can hold Your data with battery backup.
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR 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