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] Retaining of EEPROM values when power failure

Status
Not open for further replies.

achar.deepak

Member level 1
Joined
Dec 12, 2016
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
415
Dear All,

I am writing a code for one menu project. I am using EEPROM here to store some index values and some data. I need retain all these values when the power is on. My doubt is can we restore these values after turning on the power. When I turn on the power the program has to ask for restoring previous values.

Thanks
Deepak
 

Hi
yes you can restore. if eeprom is internal, on power on you can directly read the stroed values or if externally connected via i2c or spi then you need to first initialise related peripherals and then you can read.
 

Hi,

I don't understand the question.

EEPROM is nonvolatile. The data are kept even on power loss.
You may write data into the EEPROM...
and you may read this data after RESET.

Klaus
 

EEPROM data will not be erased during power-off..
 

hello

PIC Eeprom or external I2C eeprom ?
Both can keep all datas when Power Off occurs..
even it is better to manage Brown Out Reset Volatge or use a dedicated IC to survey power supply
and be able to save data into eeprom,just before MCU reseting.

you need to store an index , the last position (adresse) used to store data in to the eeprom,
in a particular position reserved for that , in the eeprom the 1rst or the last for example.
and at power on, do a init sequence to get back this last index position, as the current position ..
and go further..

if your PIC has an EEPROM size > 255 .. need to store an integer as last index used. 2 eeprom positions for MSB LSB
 

Hi,

What is if EEPROM is internal? I did not get the point.
 

hi
some pic controllers has internal EEPROMS, like in other microcontrollers you can connect external EEPROMS like Atmel 24c512 via I2C .PIC controllers has for example PIC16F877 internal EEPROM. only matter is these internal EEPROMS are of small sizes. you can do read write operation using there internal registers i.e. in PIC16F877 -> EECON1, EECON2, EEDATA, EEADR

- - - Updated - - -

Hi

for more info you can refer this link
**broken link removed**
 
Last edited by a moderator:

Hi,

What is if EEPROM is internal? I did not get the point.
I don't understand the question.
Where do you see a difference whether EEPROM is internal or external.
* an EEPROM is non volatile
* it has addresses
* you may write and read data of each address...

I see no difference.

Klaus
 

I am writing a code for one menu project. I am using EEPROM here to store some index values and some data. I need retain all these values when the power is on. My doubt is can we restore these values after turning on the power. When I turn on the power the program has to ask for restoring previous values.

As you are started to deviating from the actual question. Let me ask you related to your actual post. Have you completed writing the code for your project?

If so then start check the same with the EEPROM by writing the values in it & turn off the power. Then apply the power and read the current data in EEPROM after power on. You need to get the same value which you have written. If you get the same values then your Code/EEPROM is fine. If not either your code or EEPROM is having issue. Now reply for this to provide further suggestions.
 

Hi,

I have written the code for menu flow. Now I have store values in the EEPROM.

Thanks
Deepak
 

I have written the code for menu flow. Now I have store values in the EEPROM.

Which means that your values are stored in EEPROM and retained. If that is the case your query is resolved. Please mark this post as SOLVED.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top