avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fw: [avr-gcc-list] placing a variable in flash


From: E. Weddington
Subject: Re: Fw: [avr-gcc-list] placing a variable in flash
Date: Mon, 22 Nov 2004 11:19:21 -0700
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Royce & Sharal Pereira wrote:


================================================
Wouldn't the variable be better off stored in the EEPROM and not in
Flash (Program Memory)?
-------------------------------------------------------------------------
Is there some advantage of that as compared to storing it in flash?
Anyways, is it at all possible to fix a variable at a predetermined location
in flash ?


Here are just two advantages:

1.  Endurance.
For example, the mega128 data sheet specifies that the Flash has 10,000 read/write cycles. It specifies the EEPROM has 100,000 read/write cycles.

2. Ease of use.
Reading and writing the EEPROM is easy especially for small values, because each byte can be erased. While reading Flash is easy, it is more complicated to write to Flash because you have to erase and write a block of data at a time, which means you need to flush the contents of a Flash block to a RAM buffer, erase the block and write the block with the new contents.

The EEPROM is *designed* to hold values that must persist between power cycles. The Flash was designed to hold your program, not data.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]