Re: What is preferable for storing parameters FLASH or on-chip EEPROM ?



"yossi_sr" <YSrebrnik@xxxxxxxxxxxxxx> wrote in message
news:1121150722.999112.263590@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi All,
> Where it is preferable to store log/history parameters:
> in FLASH or in on-chip EEPROM ?
>
> I am using AT89C51ED2 8-bit MCU from Atmel.
> It has 2k EEPROM on-chip and 64kB Flash.
> EEPROM programming features:
> 1) On-chip 2048 Bytes EEPROM.
> 2) Supports only Byte programming ( no page programming).
> 3) Programming of each byte 10msec-17msec(Atmel says).
> 4) 100K write cycles.
>
> Flash programming features:
> 1) 64Kb Flash, organized in 512 pages of 128 bytes.
> 2) Byte or Page erase and programming (10msec)
> 3) 100K write cycles.
>
> My code takes about 30kB in Flash.So half of Flash is empty.
> The parameters which should be maintained in non-volatile
> memory take about 30bytes.
>
> It seems to me that using Flash for storing log data is
> preferable in this case than using EEPROM.
> The main reason is that programming 30 bytes in EEPROM
> takes more than 300 msec whereas programming 30 byutes
> in Flash takes only 10 msec!
> And if data grows up to 128 bytes it still remains 10 msec
> when using Flash.
>
> The only disadvantage is that care must be taken when
> programming Flash to not erase the log area.
> And except this I don't see any problem using Flash.
>
> What do you think of it?

Generally it is better to use EEPROM when you need to modify bytes
individually or in small groups because they can be erases that way. If you
want to save a single block of about 30 bytes in one go, as you say, then
writing to Flash is a good idea. Normally with flash you'll erase a large
block then write updates marching up the block. In this case you only need
to erase the Flash when the block is exhausted. It does mean that you need
to scan for the latest block. The big advantage is the you can write many
more times because your not reusing the same addresses very often.

Peter


.