-> I want to use internal EEPROM of ATMEGA8 as a non-volatile memory save equipment. I have one project which needs to store count value of variable as a permanently whether power is off. I read datasheet of it and found basic code for it. But when i make power off the value of variable becomes zero. Can anyone tell me how to use 512-byte eeprom memory of atmega8 as non-volatile save memory?
-> I am using avr studio 4 as debugger and compiler.
hi
how did you use eeprom in your code ?
first : #include <avr/eeprom.h>
then if you want to declare a variable that it must store on eeprom declare your variable like this:
Thank you so much alexan_e and mojtaba_led for help.........
I made simple program for use of eeprom and it works..........
But in datasheet there is written that u can write eeprom upto 1,00,000 cycles. and i want to use eeprom writing upto unlimited times. so what should i do?
But in datasheet there is written that u can write eeprom upto 1,00,000 cycles. and i want to use eeprom writing upto unlimited times. so what should i do?
i know two ways :
1. checking that the value of eeprom is changed or not before update it , to do it for example you can write :
uint8_t EEMEM NonVolatileString[20];
int main(void) {
uint8_t SRAMchar;
eeprom_update_byte (&NonVolatileChar, SRAMchar);
}
of course this way cuse to decrase the speed of the program.
2.use a circular buffer (O-buffer) in EEPROM for storing data in EEPROM.for more information visit AVR101: High Endurance EEPROM Storage