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] save data to eeprom at power down

Status
Not open for further replies.

dhakeparag81

Full Member level 2
Joined
Jun 6, 2012
Messages
131
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
INDIA
Activity points
2,406
hi guys,

Thank u for supporting my previous project.
Now,

i am trying to save data at power down

any how i try to detect power down and in interrupt routine i have to store data in eeprom in min time.
I dont want to use any battery or something else...
i just want to used internal peripherals of pic18f87k22


Suggestion Expected...
 
Last edited:

what i ment by power down ? is it intentional or is it like power outage ?
 

external supply

when external supply is cut uc not power off at the same moment i want that power down
 

Hi,

Your micro needs to monitor the power before the +5v regulator, the dc or ac.

When your program detects a low voltage then it should perform the EEprom Save.

Have you calculated how many instructions/ time it will take to run the EEprom Save ?

Have you tested your circuit to establish how long full power to the micro will be maintained when the source power is cut ?

You can increase the power off time by using a larger capacitor across the pics power rails; and isolate it from all other cicuitry with a diode.

Be aware a too large capacitor might affect the pics start up or short the regulator.

Basically your idea leaves too much to chance, thats why a small battery should be used to give you that certain time period to power down
 

at start i just want interrupt
if i will save 1 byte at start its ok for now i will increment time by using capacitor
but what should i used to detect power down.....
 

Take a look at the MCP100 voltage supervisor device from Microchip.
There is a choice of seven different trip levels.
You could connect the reset output from the chip to your micro interrupt input.

You could put a Schottky diode and cap between that and the micro to hold up the power supply while saving data.

Your micro has an analog comparator?
You could use that to detect the low supply voltage.
 
Last edited:

if i use brown out reset?

it also has voltage selection but i dont know how to initialize interrupt routine..
 

if i use brown out reset?

it also has voltage selection but i dont know how to initialize interrupt routine..


Hi,

Brown out Rreset does just that, it Resets the Pic when the voltage fall below a set level - so no way you can use that.

You do have either the ADC channel to read the input voltage, though a lengthy routine or the HLVD module, though I have never used that.

You can use it in two ways, constantly checking the HLVD IF flag from your main program loop, the easy way while developing your code or as you say allowing the full ISR to handle things.


You do not say what complier you are using so cannot give you any specifiy advice there, though I suspect using a relativley advanced smd chip like that you are using the Explorer Dev board ?
Are there not programming tutorials with that kit ?
 

Use the analog comparator!
It can generate an interrupt.

The micro you are using has three on-board comparators.
It seems like the obvious solution to use one.
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top