EEPROM data corruption

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,
I am using the AT 90S8515 microcontroller and its internal EEPROM. Data stored in the EEPROM are occasionally changing, even if I do not write the EEPROM - I only read the data. Does anybody have a previous experience on this? The code that I use to read the EEPROM is like the following one:

EEPROM_READ : sbic EECR,1 ;Check if a write Operation is in progress
rjmp EEPROM_READ
out EEARL,temp1 ;temp1 indicates the address
ldi temp,$01
out EECR,temp
in temp2,EEDR ;data read from EEPROM are stored in temp2

Thank you,
Stamatis

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Stamatis,

first - never use address 0 of EEPROM (it will become corrupted upon power-fails during write and a lot of other conditions).
second - always set EEARL to 0x00 when not needed.
third - use of EEPROM is only reliable when using brown-out-detection ( internal - if available, otherwise external).

In periods of low voltage (mainly when powering down), the may execute opcodes incorrectly. This can result in unintendend write-access to EEPROM and thus modify its contents. Mostly address 0 is effected. Sometimes address specified by EEAR is effected. That's the reason why I always set EEAR back to 0 when not used.
I also had this effect on AT90S2313, since I use brown-out-detection I never noticed this effect any more.
HTH,
/Martin.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Martin,
Thank you for your answer. Do you have in mind an IC Solution for Brown-out detection to suggest?

Regards,
Stamatis

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Stamatis,

I actually moved to the AT90S4433 (has internal brown-out-detection and I also needed ADC).

Have a look at Atmel's application note
AVR180: External Brown-Out Protection (16 pages, updated 5/02)
This Application Note shows in detail how to prevent system malfunction during periods of insufficient power supply voltage.
http://www.atmel.com/dyn/resourc...

Regards,
Martin.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

In the past 3 years I have seen EEPROM corruption three times in AT90S2333/4433 devices. Each time it occurred over a weekend and appearred to be related to a mains power supply incident in that every PC in the general area of the building had restarted (no UPS!).

Very extensive testing of the hardware and associated power supplies did not reproduce the failure. It's still a mystery.

The original firmware in the device frequently read data from the EEPROM. This program was modified to read the EEPROM only on power up/reset and the problem did not recur.

Regards,

Gordon

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Stamati,

some BODs that I use are:

MC34064,
DS1233
DS1232
TL7705

Once, I used the more complex but inexpensive reset circuit in Atmel's applnote with a few changes in the values of the components and it worked but its not very accurate and needs much board space.

I recommend you the MC34064 which costed me about 0.8Euro.

Kyriakos

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

>In the past 3 years I have seen EEPROM >corruption three times in AT90S2333/4433 >devices. Each time it occurred over a weekend >and appearred to be related to a mains power >supply incident in that every PC in the general >area of the building had restarted (no UPS!).

Are you sure you enabled the brownout detector
with the correct voltage level (by programming
BODEN and BODLEVEL fuses)?

In 2 years of 24hours per day work with code that read/write the eeprom countinously I NEVER got the eeprom corrupted on my product based on AT90S4433

admin's test signature