ElTita reacted to hmjswt in Flash memory can be damaged by writes? (and related things)
Yes, there are bigger ones.
I am using 1024 Bits EEPROMS.
Costs less then $3.00.
You can chain 8 IC's for a total of 8Megabits!.
Works like a dream.
I have a page about EEPROMS and the LaunchPad on my website.
A lot is in dutch but I translated the EEPROM page in English.
You can download the source code.
ElTita reacted to roadrunner84 in Flash memory can be damaged by writes? (and related things)
Most flash memory can only be written to 0 values in their bits, the erase cycle will set all bits to 1 again. So writing a byte, say 10101010 and then writing 01010101 will result in a byte read as 00000000. To avoid such behaviour, you should always erase between write cycles. Alternatively, always write 11111111 to any byte you do not want to touch.
Also, as suggested before, try not to keep bookkeeping data in flash (like the end-of-array-pointer). Instead, make sure the default value after erasing is not a valid statement, as a result, you can determine the end of your array by iterating over it to check for this end value.
@@hmjswt You could do that... but why? There is flash and EEPROM-emulating-flash in these chips. Replacing the microcontroller is probably cheaper these days than adding more components in case the EEPROM dies. As suggested before, using an FRAM part would be nice too, since there is no real difference between RAM and flash on those, it's non-volatile RAM.
ElTita reacted to oPossum in Flash memory can be damaged by writes? (and related things)
Flash will wear out after being erased and written many times. As a practical matter you will have to keep the pointer to the flash in RAM.
This would be a good application for one of the FRAM MSP430s. They have essentially unlimited write endurance.
ElTita reacted to igor in Flash memory can be damaged by writes? (and related things)
Keeping pointer in RAM would be good move if you could.
If you can't, can you get away with not storing a pointer at all?
When you need to add a reading, search for the the end of where readings already are - takes more time, and have to reserve one reading value to mean there is no reading, but don't have to store the pointer. Using binary search should be able to find the end in order of log2(maximum number of samples). (One of the examples below just used a simple linear search.)
I have definitely seen a temperature logger for the MSP430 using flash a long time ago.
This isn't the one I was thinking of, but similar concept.
Here is another one - which seemed to be unavailable at the moment, so I went to an archived version: