Atmega 16 (EEPROM)

Discussion in 'The Projects Forum' started by u5Al3, Jul 25, 2011.

  1. u5Al3

    Thread Starter New Member

    Dec 24, 2010
    21
    0
    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....

    }
     
  2. DickCappels

    Moderator

    Aug 21, 2008
    2,664
    634
  3. u5Al3

    Thread Starter New Member

    Dec 24, 2010
    21
    0
    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.....
     
  4. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    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
     
Loading...