How many write cycles can the HCS08 perform before destroying the memory cell?
Is it the same limit when using the Processor Expert bean, or is PE more ”gentle” in any way?
It depends on your specific MCU variant. Usually, for 9S08, I often read the 100K value. As one example with EEPROM capability (the DZ family in particular), the docs say: "Up to 100,000 program/erase cycles at typical voltage and temperature". This is per sector as you can't erase below that.
(BTW, I'm still unclear if a sector erase over some already erased bytes counts as another cycle for those already erased bytes, or the count is at the sector level regardless. But, I normally avoid that possibility so it's a non-issue for me.)
Depending on the application requirements, there are several techniques to maximize writes.
Some simple to implement examples:
* Compare for same content before writing to skip redundant erase/write cycles. Example: If the user presses 'SAVE' but content is unchanged, don't do anything.
* Write a smaller block over a larger area in a circular fashion, so that you effectively multiply life span by the number of blocks that can fit in the larger area. Ideally, blocks should fit completely in a sector so that last write does not spill over to the next sector as then the block won't have the same life for all its bytes.
* Alternatively, if the block size is close to the size of the Flash/EEPROM sector size write to same area until it fails then move to next sector. Last non-erased sector is your valid data.
* Use internal RAM for frequent updates and save to EEPROM only on timed intervals or power failure (latter requires hardware support, e.g. LVD in combination with capacitor to keep voltage above failure point for the duration of longest write.)
I believe CW only provides the low level routines to write to Flash/EEPROM but does not do any wear leveling. This is application dependent, IMO.
Bumping the question, hoping for a response.
/AJ