Usage-counter

Hi,
i want to program a counter on my SVP, which stores the counts of usages of my device. that means that every time my SVP is switched on, the counter should raise the value of 1. this value shouldn’t be overwritten by pressing the reset button or flashing a new version of my program to the device. i think thats what the EEPROM should be used for? how reliable is that kind of storage (i want to overwrite/counting up that value e.g. 100 thousand times)?

thanks!

Hello.

According to the ATmega324/1284p datasheet, the EEPROM is rated for 100,000 erase/write cycles, so it should be suitable for your purpose. AVR Libc provides some useful functions for reading and writing EEPROM and you can learn about them here:

nongnu.org/avr-libc/user-man … eprom.html

–David

Hi David,

I seem to remember that the default fuse settings for the SVP-1284 will erase EEPROM when you reprogram the device. Is this still true?

Fuse High Byte: EESAVE - EEPROM memory is preserved through the Chip Erase default value: 1 (unprogrammed, EEPROM not preserved)

Mike

Yes, that is correct. You should be able to change that fuse setting, but be careful not to change any other settings by accident. I recommend using AVR Studio 5.1 to do it.

–David