Atmega EEPROM corruption due to voltage when device is off?

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

I am currently developing a battery powered device that makes use of the Atmega128 EEPROM to store configuration settings and checksums on data. Recenttly, a modification was made to the PCB that permanently connected the battery (through a voltage divide circuit) to one of the ADC pins to measure battery level..

Since this modification, I've noticed that the checksums and other information in the EEPROM are becoming corrupted. I tried implementing reduncancy on the checksums by using a majority vote and re-writing any checksums that were "out-of-synch". This did not work however as all 3 of the EEPROM locations I was storing the checksums became corrupted. So i think something else is up...

Since the battery is constantly connected to the Atmega's ADC I/O pin, there is a small voltage (about 0.5 to 0.6 volts) between Vcc /AVCC and GND all the time. This worries me... Could this small voltage being applied to the pin, over time, corrupt the contents of the EEPROM? how likely is this and how long would it take to change the contents of the EEPROM?

I am using an Atmega128 (3.3v version) with ADC set to use internal ref voltage (2.56v). I am not setting the BOD fuse on the device. (bad, I know!) Checksums were spread out over a 64 byte range in the EEPROM.

Please give me some advice on this problem.

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

Is the processor's Vcc being switched off? That might cause a problem with no Vcc but a voltage present on an ADC input. Why not try one of the sleep modes, instead of turning off power?

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

Also tell more about brown-out. Yah >>gotta<< have brown-out on an AVR, either internal or external, to avoid EEPROM problems. As a guess your processor is trying like a steer to keep running too long at power-down, and/or the processor is kinda running off one or more of the port pins or AVcc or ARef or ...

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Vcc is being switched off. There is a switch on the device that turns off a votlage regulator and shuts down the power rail. However, there is still a voltage being applied to the ADC0 pin by the battery voltage divide circuit (about 1.1v). even though the device is off. This is what concerns me....

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

So, what is your brown-out provision?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Quote:
I started avoiding EEPROM location zero and leaving the pointers set to zero after each use so that a glitch (sorry Glitch ) would only tromp on location zero.

Have a look at https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=24138
C.H.

C. H.
-------------------------------------------------------------------
It's only waste if you don't use it!

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

You should disconnect the divider supply when powered down, as there will be a constant current dain via the protection diodes.

Keep it simple it will not bite as hard