Search This Blog

Loading...

Monday, March 31, 2008

Working / Using EEPROM in WinAVR (AVRGCC)

Include the EEPROM API file (module which handles the interface on behalf of you)

#include



Define the Variable (where you want to put it)

#define BK_LIGHT_SETNG 0x00



write to the location

eeprom_write_byte((uint8_t*)BK_LIGHT_SETNG,0x7); //! read the settings



Reading the byte

xx = eeprom_read_byte((uint8_t*)BK_LIGHT_SETNG);



//=====================================================


you don't need to do anything from scratch, The work has already been done for you just use the interface header files.
AVR GCC Rocks... Free of cost... save lot of development time... and even the compiler is free, up to date with solid tools... (where you need to pay nearly $4000 + for tools like Keil)

1 comment:

Anonymous said...

it is useful. variable name should be more informative like *addr