AVR flash life

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

Hi Freaks,

I have an M48 which I have been using for the past year or so. I have programmed the flash multiple times now. Is there a way I can find out how many times the flash has been programmed? Any count in the flash that can be read back?

Thanks.

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

None that I know of, but you're probably not wearing it out.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

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

Quote:

Is there a way I can find out how many times the flash has been programmed? Any count in the flash that can be read back?

Nope. But given the 10,000 cycle limit then you would have to have programmed it about 28 times per day for all 365 days to be anywhere near the limit. It's unlikely. But if really worried splash the entire $2-$3 and buy a new one.

Actually debugging with debugWire is more likely to wear the chip as each time a breakpoint is set (including single stepping) it writes the flash.

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

Ok thanks for the info.

I understand the longevity of the flash.

I wonder if there is a way to write a count to external/internal flash/EEPROM and incrememt it every time I program my AVR. And then you could read back the count in a variable and display it on an LCD.

Something like showing battery life in a handheld.

Wouldn't there be >>something<< in the AVR that got incremented with every erase and program cycle?

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

Avrdude has the '-y' option to log an erase cycle count.

Other programmers may have other options. But in all honesty, it is easier to just buy a new chip every now and then. (five years)

Even Bob had to buy a new Mega32.

David.

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

Every time you hit a breakpoint during a debug session it will restore the original instruction, execute it, then replace it with a break instruction again. IIRC JTAG only support 3 hardware break points, and for more breakpoint resorts to this method. I'm not sure if DebugWire devices have hardware breakpoints.

So an AVR that has been debugged heavily might have locations that are more worn then others. That's why Atmel recommends not to ship products with AVRs that were used during debugging.

It's not like Flash fails catastrophically when you erase it for 10,001 time. Probably you can use it at least twice as much before certain locations refuse to clear or set and that you get verification errors.

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

Quote:

I'm not sure if DebugWire devices have hardware breakpoints.

Nope they are all soft which is why it says that thing in Studio help that you shouldn't use a development AVR in a production app as it could be well worn by the time you've finished development.

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

Like I said :)