flash read/write cycles

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

flash read/write cycles

5,086 Views
Guilly
Contributor I
Hi,
I am currently working with a HC08JK3, for a small project that needs to use some of the Flash memory for data variables. I read in the manual that the Flash has 10k erase/program cycles. I question is, every time I write the Flash, even if I write only one byte, it counts as a program cycle.
As far as I knew, the only important thing to consider about the Flash memory were the erase cycles, because the critical operation was to "raise" the bits from 0 to 1. Can someone help me ?
Greetings
Sebastián
Labels (1)
0 Kudos
Reply
5 Replies

2,062 Views
mke_et
Contributor IV
Just remember that you now have 2 values that cant be data. Obviously FF and 00 for a byte. FF means unused/erased, and 00 means invalidated. That is, if you want to do it without a 'header'.

Personally, I use a 'header', and find it, then use variables that are indexed off the header location. That way I can keep a whole structure of variables in Flash.

Message Edited by mke_et on 06-06-2006 10:57 AM

0 Kudos
Reply

2,062 Views
bigmac
Specialist III
Hello Sebastian,
 
Have a look at AN2346 "EEPROM Emulation Using Flash ...".  This details a system for giving multiple writes for each page erase.  The MCU is the 908QT/QY, but the firmware should readily adapt to the 908JK3.  The firmware is written in assembler (rather than C).
 
Regards,
Mac
 

Message Edited by bigmac on 06-06-2006 01:16 PM

0 Kudos
Reply

2,062 Views
mke_et
Contributor IV
Write a byte, it counts for a write to THAT location. Now, if you only use one byte, and change it 15 types, yep, that's 15 write cycles.

However, if put a 'definable header' there, and when you don't want to use a byte, just zero the header, then move to the next block...

You can write till you fill up the entire free flash area and it still only counts as 1 write cycle. Then when you run out of space, you can erase the whole area, and start again, this time as the SECOND write cycle.

But... I don't use the flash on my 08 project. Is it erasable in less than the full part size? If so, then this works. If you have to erase the whole part, then how are going to do that even with the scheme suggested in your original question?

Mike
0 Kudos
Reply

2,062 Views
Guilly
Contributor I


mke_et wrote:
Write a byte, it counts for a write to THAT location. Now, if you only use one byte, and change it 15 types, yep, that's 15 write cycles.


So, you are telling me that the program count is for every byte position??? It seems logical to me, at least it matchs with I learned before...
I can erase a full page (i.e. 64 bytes), and write every single byte, so if I use a full page for storing a single byte variable, I should "multiply" the life of the Flash to 640K cycles if I write the variable in the next free spot of the page, and erase it only when I reached the end of the row...

Greetings
Sebastián
0 Kudos
Reply

2,062 Views
RockyRoad
Contributor III
Sebastián -
 
Yes, your understanding is correct. You can program each of the 64 bytes in the page once before you erase and that counts as 1 program/erase cycle. As you say, this gives you effectively 640K times that you could write one variable to flash over the lifetime of the part.
 
- Rocky
0 Kudos
Reply