Author Topic: How many times can you program the flash memory?  (Read 2376 times)

0 Members and 1 Guest are viewing this topic.

Offline jackpTopic starter

  • Jr. Member
  • **
  • Posts: 13
  • Helpful? 0
How many times can you program the flash memory?
« on: April 27, 2010, 04:55:46 PM »
Hi,

Is there a limit to the number of times you can write the flash memory with the programmer? 

I've been debugging by iteratively changing a couple of lines of code, uploading the new program and assessing results and not sure if this is best practice.

Thanks
Jack

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: How many times can you program the flash memory?
« Reply #1 on: April 27, 2010, 05:14:36 PM »
10 year 10,000 program warranty  ;D
Look in the datasheets and its on the first page  ;)

Offline chelmi

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Re: How many times can you program the flash memory?
« Reply #2 on: April 27, 2010, 05:16:33 PM »
the datasheet says:

Quote
Write/Erase cyles: 10,000 Flash/100,000 EEPROM

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: How many times can you program the flash memory?
« Reply #3 on: April 28, 2010, 06:32:15 AM »
Its a bell curve failure rate - whats in the datasheet is just the average. It also doesn't state how it fails (ie bad sectors, or entire failure), or what that bell curve looks like.

Just don't use EEPROM like RAM, and you won't have a problem. EEPROM is meant for data that slowly/rarely changes.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: How many times can you program the flash memory?
« Reply #4 on: April 28, 2010, 03:00:19 PM »
Hi,

Although it isn't applicable here; when you need flash memory in general to live as long as possible, just make sure to spread the use over the entire map.
Bad sectors should be mapped out of course, but there isn't really any rigid data on how much of the chip must be good to call it go or no-go.

But... it's a common concern among newbies that use crash-and-burn programming, but even with that sort of programming, 10,000 cycles is a whole lot of button pushing, so stop worrying.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline corrado33

  • Supreme Robot
  • *****
  • Posts: 611
  • Helpful? 11
Re: How many times can you program the flash memory?
« Reply #5 on: April 28, 2010, 04:22:50 PM »
Hi,

Although it isn't applicable here; when you need flash memory in general to live as long as possible, just make sure to spread the use over the entire map.

So if my program only takes up 10% of the space available in flash memory... how do I program it to the 2nd 10% available, then the third, then the forth etc, so I spread it out over the entire space?  Is that what you were saying?

Offline chelmi

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Re: How many times can you program the flash memory?
« Reply #6 on: April 28, 2010, 04:42:49 PM »
Hi,

Although it isn't applicable here; when you need flash memory in general to live as long as possible, just make sure to spread the use over the entire map.

So if my program only takes up 10% of the space available in flash memory... how do I program it to the 2nd 10% available, then the third, then the forth etc, so I spread it out over the entire space?  Is that what you were saying?

;)

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: How many times can you program the flash memory?
« Reply #7 on: April 28, 2010, 05:22:36 PM »
Hi,

Although it isn't applicable here; when you need flash memory in general to live as long as possible, just make sure to spread the use over the entire map.

So if my program only takes up 10% of the space available in flash memory... how do I program it to the 2nd 10% available, then the third, then the forth etc, so I spread it out over the entire space?  Is that what you were saying?
That's more or less how some Flash RAM controllers work automatically (don't know if it's outside the proto-labs yet though). A similar method was devised for EEPROMS in the eighties. The key is to have a scratchpad with an index/pointer to start and length.
It could be that you allways get a pointer from an outside switch selectable PROM, like in an interrupt vector controller. That way you never changes the first jump and the second get vectored to whereever the new code is.

But, I repeat "isn't applicable here" where we're talking about program memory.

That said, I bet I could do it, if the controller had enough space to make it worthwhile, but then again, how long would it take/how high do you value your time, compared to the the fact that a new controller is cheaper than dirt, so just pop a new one in.


A hobbyist isn't likely to go through 10,000 cycles to get a program right (or they would probably give up and find another hobby) and when the program work, I assume the chip is normally not reprogrammed, as it then sits in a PCB doing a job.

Yet another perspective: a midrange controller is around 1/4 to 1/2 the price of a plain hamburger - drop one hamburger (might be healthy and won't hurt nothing) and you have the equivalent of 20,000 to 40,000 more burns in reserve.


Don't worry, be happy and brush your teeth  ;D
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline corrado33

  • Supreme Robot
  • *****
  • Posts: 611
  • Helpful? 11
Re: How many times can you program the flash memory?
« Reply #8 on: April 28, 2010, 05:47:11 PM »
Hi,
But, I repeat "isn't applicable here" where we're talking about program memory.


I uh... missed that part.   ;)  Honestly I was never worried, since as you said, MCUs are very cheap.  A few bucks isn't worth the time it would take to preserve the flash memory of an MCU. 

 


Get Your Ad Here