I want to implement a counter which can save values through power cycles, so I should use flash memory(I have option to choose NOR or NAND) but as my counter values will be increased frequently. I want to optimize number of erases(considering only erases i.e making bits 0 to 1 will effect the flash life span).
For that I want to implement tick counter In which sequence of bytes(around KBytes, depends on my counter maximum value, usually equal to block size) allocated to counter for each increment successive bits will be set to 1 to 0 starting from MSB. I will write custom flash driver to take care of counter operations.
Val0: 1111 1111 1111 1111 .... Val1: 0111 1111 1111 1111 .... Val2: 0011 1111 1111 1111 ....
Advantages tick counter:
Erase required only when we want to make counter to zero.
But is it possible to program a bit from 1 to 0 without erasing(NAND/NOR), if yes will that effect P/E cycles count?