Topic : EEPROM programming overhead

Forum : ST7/STM8

Original Post
Post Information Post
February 23, 2010 - 7:07am
Guest

Hi all,
I am new to this forum. I was developing an application that extensively uses the eeprom with STM8S family. My question is: Does having a external eeprom solve the overhead(delay) caused by the eeprom write cycles? I am so concerned about the delay because the block write cycle automatically disables other interrupts which makes my application sluggish. But the application must run in real time.

Thank you.

Replies
Post Information Post
+1
0
-1
February 23, 2010 - 10:29am
Raisonance Support Team

Hi,

This is a very device-specific question.
Depending on the data you want to handle you can read and write to EEPROM just as if it was a RAM location, except that the bus will stall for each access (which makes the EEPROM read/write slower). If you are writing single bytes, this method may be very efficient and simple.
The 32-bit word write offers better performance if your data objects are 32-bits wide.

And a full page write is expensive, but I doubt an external EEPROM would raise better performance (except perhaps if you use an STM8 which has DMA capability).

Another issue that you have to consider is the number of writes to the EEPROM: The STM8 EEPROM endurance is around 100000 writes (check this in your datasheet) which is not much. If you need more endurance, then an external EEPROM with millions of Writes endurance will be necessary.

I hope this helps. You should ask the ST support people for better advice anyway.
Bruno

+1
0
-1
March 1, 2010 - 5:07pm
Guest

My application does not require intensive use of EEPROM but does require low latency. My solution is to only write one byte at a time and only to do it when the FLASH/EEPROM peripheral is not busy. You can try something like this:

[0. Declare global volatile bit variable called ee_busy]
1. Set ee_busy bit when a write operation begins
2. Clear ee_busy bit when handling EOP interrupt
3. Poll ee_busy in main loop
4. When ee_busy == 0 (EEPROM is not busy) and data is ready to be written, call function to sequence next byte write operation. (I have a function that compares each byte of a RAM variable with an EEPROM variable then writes the first byte that is different and exits)

Hope that helps