HELP!! EEPROM is loosing data !!

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

HELP!! EEPROM is loosing data !!

Hello Everyone smiley

 

i have a problem with EEPROM 

 

i have a voltage stabilizer's circuit controlled by ATMEGA328P.

 

the problem is :

the eeprom sometimes looses the data stored in it, even though i left the first 99 address empty. 

 

i'm using an isolated SMPS flyback circuit to power the circuit , the attached circuit shows the way i'm using to measure the AC mains voltage, i'm using a voltage divider and LM358 as a buffer.

the 220VAC is wired directly to the board without any isolation and mains neutral is connected directly to the PCB's ground.

 

i'm wondering if the way i'm using to measure the mains voltage has any thing with this problem!! 

 

So How can i solve this problem?!!

 

Thank you ALL

 

Attachment(s): 

Last Edited: Thu. Jul 11, 2019 - 03:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does the CPU have  BOD enabled as it suggests in the datasheet for avoiding EEPROM corruption?

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

no it doesn't 

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

Mohammed-ram wrote:
i'm wondering if the way i'm using to measure the mains voltage has any thing with this problem!! 

Me too!  What does the power supply signal look like on a scope?

Do you have bypass caps on VCC and AVCC?

How experienced are you working with line voltage?  It has been known to kill!

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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


328P datasheet wrote:

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

ki0bk wrote:

Mohammed-ram wrote:
i'm wondering if the way i'm using to measure the mains voltage has any thing with this problem!! 

Me too!  What does the power supply signal look like on a scope?

Do you have bypass caps on VCC and AVCC?

How experienced are you working with line voltage?  It has been known to kill!

 

Jim

 

 

the power supply looks like a straight line with a hard to notice very little noise.

i have a 4.7uf and 100nf nearby to the MCU's power pins and AVCC (two groups) and a 100nf from Aref to the ground .

and yes i'm well experienced with working with line voltage and i take caution.

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

Make sure you have selected the right BOD fuse setting for your VCC level, as noted in the data sheet about EEPROM corruption.

 

Mohammed-ram wrote:
yes i'm well experienced with working with line voltage and i take caution.

Good to know!

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

clawson wrote:

328P datasheet wrote:

i think this is my problem, i'll try it for a few days and i'll tell you what happend.

thank you

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

ki0bk wrote:

Make sure you have selected the right BOD fuse setting for your VCC level, as noted in the data sheet about EEPROM corruption.

 

Mohammed-ram wrote:
yes i'm well experienced with working with line voltage and i take caution.

Good to know!

 

Jim

 

thank you for your care smiley