AVR101: High Endurance EEPROM Storage questions

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

. . . near the top of page 2

***
After a RESET it is then possible to look through the Status Buffer,
finding the last Status Buffer element changed by finding the location where the difference between a buffer element and the next buffer element is bigger than 1.
***

Appears to me that if you got a reset on the first slot that you would not be able to find the last changed buffer item.

Guess chances of that happening are pretty remote, but has anyone modified the code to take care of this case? Maybe, for the first write operation write to both elements 1 and 2. Then the difference will always be bigger than 1.

Also, in the code:

high_endurance_EEPROM.c there is a statement:

// If self-programming is used in the application, insert code here to wait
// for any self-programming operations to finish before writing to the
// EEPROM.

I assume, from the datasheet (see below), that I just keep testing SPMEN to see when it clears. Correct?

Why would one want to write to the EEPROM while you are self-programming the device??

Thank you.

***
• Bit 0 – SPMEN: Store Program Memory Enable
. . . The SPMEN bit will auto-clear upon completion of an SPM instruction, or if no SPM instruction is executed within four clock cycles. During page erase and page write, the SPMEN bit remains high until the operation is completed.
***

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

"Why would one want to write to the EEPROM while you are self-programming the device??"
AVR109 code allows programming of either flash or EEPROM. From what I remember, EEPROM takes longer to write than flash and writing to either one during a SPM instruction will cause an error.

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

Magno_grail,

After further consideration I think I should have said, "why would one want to write to the EEPROM while you were writing to the flash".

I guess if you are "trigger-happy" and not wait until the flash had finshed being programmed then hit a "load the EEPROM button" then bad things will happen.

Thank you for the response. I will read AVR109 carefully

Cheers,
davef

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

Quote:

I guess if you are "trigger-happy" and not wait until the flash had finshed being programmed then hit a "load the EEPROM button" then bad things will happen.

The thing being trigger happy could be a piece of automated programming software, not necessarily a human hitting the "Program EEPROM" button. For example the "Auto" tab in the STK500 dialogue in AV R Studio.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Fair enough!

Just couldn't really see how this issue was going to effect the application I am writing where I just want to write/read data to the internal EEPROM during the normal course of running my program.

My conclusion . . . it won't.

Thanks everyone.