Using EEPROM for variable in AVR

Status
Not open for further replies.

RollingEEE

Full Member level 3
Joined
Mar 25, 2006
Messages
165
Helped
8
Reputation
16
Reaction score
7
Trophy points
1,298
Location
Bangladesh
Activity points
2,406
Hi. I want to declare a non-volatile variable ifor AVR. The variable must retain it's value without any power, and also, it's value should be modifiable by the on-chip program. Can any one give me some programming example, in C language?
 

Re: Using EEPROM in AVR

using Eeprom for a variable that should be changed anytime in chip program is not a good way !!!
you'd better use a backup battery and use RAM .
you also can use high capacity capacitors used except battery ! they are smaller . don't forget to make your MCU in lowest power using mode when going off !

i say it because eeprom has a life wich maybe finished during MCU working if you write on it too many times ... !then your device wouldn't work , i haven't worked with C language , but i think it is not possible to declare a variable in eeprom usually , you should write subroutines wich saves and reads that eeprom address as variable , you also shuold take care of programming time needed for eeprom ! it is not as fast as RAM is ! it takes some mili secondes depending upon different conditions ( voltage ... ) you can get more informatin from the chip datasheet .
 

Re: Using EEPROM in AVR

Thank you. Power saving mode might be an option, but suppose I am making a voltmeter with an AVR, and I want to keep a calibration option. Now I won't be calibrating it more than 16 times a year. In that case, if I need to recalibrate every time I replace the battery. So I would love to use the EEPROMs for variable
 

Re: Using EEPROM in AVR

yesss ! , for that application , eeprom is the best choose !
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…