Atmega 16 (EEPROM)

Thread Starter

u5Al3

Joined Dec 24, 2010
21
Hi all::::::




i have problem to save data in internal EEPROM of Atmega16......
i am using avr-gcc compiler....
if any one have idea plz do tell me.....

the code is



int EEPROM_write ()
{
while ( EECR & (1<< EEWE) )
{
EEAR = 0x02;
EEDR = n_dist;
EECR = 0x06;
}

return 0;



this function will call when atmega16's external interrupt (INT0) is active....


i dont no about any lib (header file) need to include in code....

reply as soon as possible....
thnx....

}
 

Thread Starter

u5Al3

Joined Dec 24, 2010
21
Sorry ............
i can not find any idea........... how to write data in eeprom (ATmega16)
...
if any one have code related to write in eeprom plz share it.....
 

hgmjr

Joined Jan 28, 2005
9,027
Here is a link to just one of the tutorials available on the Internet on reading and writing to EEPROM. As already mentioned, You will need to include eeprom.h in your source file as it contains all of the function calls you will need to interact with the AVR's internal EEPROM memory.

hgmjr
 
Top