Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] how to save a variable's value permanently in memory of atmega16

Status
Not open for further replies.

prashanttyagi85

Advanced Member level 4
Full Member level 1
Joined
May 5, 2011
Messages
106
Helped
33
Reputation
66
Reaction score
33
Trophy points
1,308
Location
india
Activity points
1,982
dear all
i am working on a RGB light using atmega16
i just want that at power on my device should glow the LED from last sequence at which my device made off due to power off.
i have used here a variable, the value of this variable changes frequentally for changing the mode of LED. and at power on its value is 0. i just want that at power on it must hold the last value which was available in it at the time of power off.
please help me.
 

Most prom can retain values even when the device is turned off But RAMs can't be used here for the same purpose
 

i don't know the assembly. please provide me a sample code in c
 

thank you tahmid bhai
i'll check it & if i'll having any problem then come back to you

- - - Updated - - -

i have studied the given link as well as datasheet also
but i couldn't do it.
please help me
 
i have studied the given link as well as datasheet also
but i couldn't do it.
is the .hex file & .eep file are same??
in my system it is showing same data in both file!!!!!!
please help me
 
Read https://www.edaboard.com/blog/862/

The eep file and hed are not the same, one has flash content and the other the eeprom content, they should both be written if you intend to write values in eeprom while programming the chip.
 

You write them using the programmer, one will fill the flash and the other the eeprom
 

These two files are generated from the compiler, depending on the initial content of the eeprom the eep file may be empty.

What do you mean by "in programmer (ponyprog) i found both the files with same content" , ponyprog doesn't generate them.
You just select which files you want to write so have you selected the proper files?
 
i mean that after compilation using avr studio when i start ponyprog for burning the files, it provide me options of:- open flash file(.hex) & open eeprom file(.eep) when i invoke them i get the same content of both file in open option of ponyprog
 
I haven't used ponyprog so I have no idea about it.
It is very easy to compare the content of the two files, just use any editor.
 

ok thanks
will you provide me any sample code for atmega16

- - - Updated - - -

tahmid bhai

i am implementing a RGB light using pwm with atmega16. i wrote code for different colors using functions. now i call them in different ways for generating different petern of colors. i am also using intrupt to change the colors using 1 switch. when i press switch each time one variable is incremented and the value of variable define the color which have to glow. now i want that if i remove power supply & connect it to power after some time then it should on from that pattern at which it made off
help me to do this
hoping to get the solution for it soon

- - - Updated - - -

hi everyone
please help me.

i just want to save a variable in eeprom frequently in my project. i am having one variable, the value of that variable will change time to time. let the power is off. now after some time power is on now my device will on, i want that the value of that variable should remain same as at the time of power off. i.e. let the value of variable is 10 at the time of power off. then i require the value of variable as 10 only at the time of power on
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top