EEPROM ATmega32

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

Dear everyone,
I wonder if you have experienced the same phenomena as I have when using the EEPROM. When writing and then reading the EEPROM nothing special happens, but when only reading the EEPROM the cpu restarts!!! Do anyone knows why?

Is there any way to restart the cpu by writing code with errors, even though it has passed compilation?! Thankful for any hints...

/Jonas

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

Have you checked the MCUCSR to see what type of reset you have?
I would suspect the value you are reading from the eeprom is offsetting the prog to an odd location.

Keep it simple it will not bite as hard

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

Quote:
Is there any way to restart the cpu by writing code with errors,
YES. If your code does not return properly, for instance Pushing and Popping stuff on the stack incorrectly. The assembler/compiler does not know anything about that. Check you reading routine with the simulator (i.e. in slow motion) and see what happens.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Thanks for your help!

I wonder what kind of bits in MCUCSR do your refer to?! I know I am using Brown-out Detection but this should not be triggered every time I read the EEPROM... ?!

Thanks again!

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

Watchdog, if you are using that just to see if going into a loop and being pulled out by it; or if the other contender, false addressing

Keep it simple it will not bite as hard

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

What language is your program in?
Have you initialized the stack?
Are you assembling/compiling for the correct uP?

Quote:
even though it has passed compilation?

This doesn’t mean the program does what you want, just that it has no syntax errors.