Searching \ for 'Saving contents of a mcu to eeprom' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/mems.htm?key=eeprom
Search entire site for: 'Saving contents of a mcu to eeprom'.

Truncated match.
PICList Thread
'Saving contents of a mcu to eeprom'
2003\01\15@061839 by 8859-9?B?1m1lciBZYWxo/Q==?=

Is there a way to save couple of bytes (8 or 10 bytes) to eeprom just before power outage?

* I am using MPLAB C18 (the software is in C)
* The unit is working with 220V AC converted to 12V DC then 5V DC.
* Configuration bit is set so power on reset on, brown out detection on, brown out voltage 4.2, oscillator H4 (10MHz xtal working at 40MHz).

I looked up the datasheet, according to page 27, I checked the RCON registers POR bit (that is the only one affected with brown out for some reason) and saved 8 bytes to eeprom if the POR bit was 1.  I did this at the very first thing in the main() procedure.  However, it did not work.  Any ideas?

If anyone is interested the product can be seen at: www.teksan.com.tr/vana.asp?L=E&Id=0401
or goto http://www.teksan.com.tr, select product then bathcing solutions.

Thanks,

Ömer YALHI
spam_OUToyalhiTakeThisOuTspamteksan.com.tr
http://www.teksan.com.tr/
Tel : +90 212 613 22 00
Fax: +90 212 544 70 35

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body

2003\01\15@063540 by hael Rigby-Jones

picon face
{Quote hidden}

comparator with an adjustable reference set using the LVDCON register.  If
the supply falls below the reference voltage, and interrupt will be
generated which you can capture and use to store you data.

Ensure you have enough time remaing to store your 10bytes after the
interrupt, the EEPROM memory typicaly takes 4ms per byte to write.

Regards

Mike


=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to EraseMEpostmasterspam_OUTspamTakeThisOuTbookham.com.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2003\01\15@085518 by iso-8859-1?Q?=D6mer_Yalhi?=

flavicon
face
Hi Mike,

LVD function works beatifully!  Thanks.

Ömer YALHI
@spam@oyalhiKILLspamspamteksan.com.tr
http://www.teksan.com.tr/
Tel : +90 212 613 22 00
Fax: +90 212 544 70 35


Check out the Low Voltage Detect (LVD) function.  This is effectively a
comparator with an adjustable reference set using the LVDCON register.  If
the supply falls below the reference voltage, and interrupt will be
generated which you can capture and use to store you data.

Ensure you have enough time remaing to store your 10bytes after the
interrupt, the EEPROM memory typicaly takes 4ms per byte to write.

Regards

Mike


=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to KILLspampostmasterKILLspamspambookham.com.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservspamBeGonespammitvma.mit.edu with SET PICList DIGEST in the body

2003\01\16@153312 by Andre Abelian

picon face
Omer,

This is what I would do.

1. find out minimum voltage that you think you want to
  save it when it gets below that suppose the voltage is 2,4 volts
2. connect one of your analog pin to read the voltage or external
  comparator if you are using digital input
3. in your eeprom reserve one byte to indicate there was a
  power surge suppose 0x00 is ok 0xFF is power surge
4. on your main code always read the pin and save to eeprom
  no matter what if it is reached below 2,4 then update surge register
to 0xFF that way after it turned off and back on you will know about
it.
4. if on your board there are other components that is part
  of eeprom data then you need to check them too to see how much time
  do you have to save every thing.

Andre Abelian


{Original Message removed}

2003\01\16@205314 by Bill & Pookie

picon face
One thing to be aware of is that as power drops,
the data, address and control lines to devices may
enter "undetermined" states.  If the eeprom is
still working at this low voltage, there is no
telling what will happen.

So maybe best not to leave the eeprom set to a
address that has valid data (if that can happen).
But do leave the control lines close to ground.

Bill


----- Original Message -----
From: "Vmer Yalhi" <TakeThisOuToyalhiEraseMEspamspam_OUTTEKSAN.COM.TR>
To: <RemoveMEPICLISTspamTakeThisOuTMITVMA.MIT.EDU>
Sent: Wednesday, January 15, 2003 3:17 AM
Subject: Saving contents of a mcu to eeprom


Is there a way to save couple of bytes (8 or 10
bytes) to eeprom just before power outage?

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestEraseMEspam.....mitvma.mit.edu>

2003\01\16@213838 by Spehro Pefhany

picon face
At 05:48 PM 1/16/03 -0800, you wrote:
>One thing to be aware of is that as power drops,
>the data, address and control lines to devices may
>enter "undetermined" states.  If the eeprom is
>still working at this low voltage, there is no
>telling what will happen.
>
>So maybe best not to leave the eeprom set to a
>address that has valid data (if that can happen).
>But do leave the control lines close to ground.

The *safe* thing to do is to force a reset on the PIC before it
enters such uncharted territory. Anything else and he's gambling.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
EraseMEspeffspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestEraseMEspamEraseMEmitvma.mit.edu>

2003\01\17@075923 by Bill & Pookie

picon face
Spehro,
I have never designed a circuit with power fail
capacity.  Sounds like you have.  so I appreciate
what you say.

The case I am relating to was where I had nothing
to do with the design of the circuits,  not that I
would have done anything different.  It was
designed 20 years or so ago and had a 2k byte by 8
bit static memory that was battery backup.  This
memory was the only ram on the board so it was
used for logging as well as everything else.  The
power supply was powered through the micro switch
interlock for the cover that would be opened
often.  Now I know that this means "trouble" is
ahead.

So when power went off, the ram was still
functioning, and if the chip select and read/write
lines were in the proper state, the ram would
write the unspecified data lines into the memory
depending on what order the address lines dropped
power.  Actually seen the results in the ram chip
one time.

So I would now try to insure that random stuff on
the lines could not affect the logging device as
power drops.  Would it be possible to load the
chip select line so it goes to a safe state before
power drops all the way?  No need to answer as I
know nothing about eeproms and do not intend to
design a circuit.

As to logging in general, a simple check sum of
the logged data would help insure it was valid
before it was used.

Bill

{Original Message removed}

2003\01\17@084254 by Spehro Pefhany

picon face
At 04:57 AM 1/17/03 -0800, you wrote:

>So I would now try to insure that random stuff on
>the lines could not affect the logging device as
>power drops.  Would it be possible to load the
>chip select line so it goes to a safe state before
>power drops all the way?  No need to answer as I
>know nothing about eeproms and do not intend to
>design a circuit.

Sure, at least on the SPI ones and some others
there is a /CE  and/or a write-enable
line that you can drive high or low and it will
prevent writes. Anything that prevents writes in
hardware from the point (voltage, and time) where
the micro is last guaranteed to work perfectly to
the point (voltage, time) where the memory
is first guaranteed NOT to work will do the
trick (but the latter voltage may not be on the
data sheets).

I once had to fix up a design where the thing
worked perfectly in about 9 of 10 units in the
field, but for about 10% of the micros, they would
do something Not Good as they were powering down,
and corrupt EEPROM. Needless to say, this was
expensive for the manufacturer to fix, getting all
those errant units back, not to mention the damage
to their reputation in the market.

>As to logging in general, a simple check sum of
>the logged data would help insure it was valid
>before it was used.

Sure, or a CRC. Hamming codes are sexier, but
when I looked into them they didn't match the
patterns of corruption very well.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
RemoveMEspeffspam_OUTspamKILLspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...