About a year ago, I was poking around and I noticed this in eeprom.c
I often update data structures to EEPROM, and I'm concerned that I might be putting more wear on the EEPROM than I should be. Below is my code for writing a structure to EEPROM. Has anyone made something similar that takes into account the above suggestions to ensure optimal endurance? I notice EEPROM.h has a put function. Does that take the above recommendations into consideration?
Code:
// The EEPROM is really RAM with a hardware-based backup system to
// flash memory. Selecting a smaller size EEPROM allows more wear
// leveling, for higher write endurance. If you edit this file,
// set this to the smallest size your application can use. Also,
// due to Freescale's implementation, writing 16 or 32 bit words
// (aligned to 2 or 4 byte boundaries) has twice the endurance
// compared to writing 8 bit bytes.
I often update data structures to EEPROM, and I'm concerned that I might be putting more wear on the EEPROM than I should be. Below is my code for writing a structure to EEPROM. Has anyone made something similar that takes into account the above suggestions to ensure optimal endurance? I notice EEPROM.h has a put function. Does that take the above recommendations into consideration?
Code:
void writeBlock(char* data, int startPos, int size)
{
for (int x = 0; x < size; x++) {
EEPROM_write(startPos+ x, data[x]);
}
}