Memory burnout

KIGX

Member
I have read in the manual that a PICaxe can be programmed about 100000 times. The program is in FLASH memory and this seems to be the limit for FLASH devices. My question is "is there any difference between the FLASH memory where the program goes and the EEPROM memory where you can stuff data"? I suspect not. If so, that seems to imply that you can only peek and poke data into a particular address 100000 times. So if I set up a weather station and peek and poke data once a minute my simple math seems to imply that I'll burn out that address in 100000/60/24/2 = 35 days. That doesn't seem very practical. Even if I do it once every 10 minutes it's still only a year.

If I burn out that address, what happens? Does the entire chip die or just that address? Can I just move on and burn out another address or do I go buy a new chip? Do you get any warning or is there a sudden puff of smoke as the chip goes up in flames?
 

jglenn

Senior Member
That appears to be the life spec of the EEPROM, not the flash, which should be infinite.

It is well known you cannot continuously write to EEPROM, some use FRAM instead, has little tiny pieces of ferrite I think that stores the 0 and 1 bits. No limit, and nonvolatile too. EEPROM write cycles may also be relatively slow, compared to other memory types.
 

ylp88

Senior Member
You should note that the PEEK and POKE commands access FSRs which are SRAM. This means that they have an unlimited read-write endurance - they do not access the Flash program memory which, as you have pointed out, has a limited endurance.

READ and WRITE commands write to the non-volatile EEPROM on the chip which usually had a rated endurance of 10 million cycles.

Also, if I recall correctly, the endurance of EEPROM (of which Flash is a type, but is usually erased and written in blocks, instead of individual bytes) is usually conted by erase-write cycles, not read.

ylp88
 
Last edited:

KIGX

Member
Hey everybody,

Thanks for the input. I read the datasheets and followed the supplied threads. Very interesting. The stuff I still have to learn...

With an endurance of 10 mil cycles for the eeprom I could peek and poke once every 2 minutes for 20 years. At that point it would be seriously questionable as to whose memory was lasting longer, the PICs or mine...

Even more likely, the weather station would have died from some other incident.

Thanks

Bob
 

jglenn

Senior Member
I'm going to try one of these soon:

http://www.ramtron.com/

Nonvolatile F-RAM Memory

F-RAM products combine the nonvolatile data storage capability of ROM with the benefits of RAM, which include a high number of read and write cycles, high speed read and write cycles, and low power consumption. Our F-RAM product line features various interfaces and densities, which include industry-standard serial and parallel interfaces; industry standard package types; and

4-kilobit, 16-kilobit, 64-kilobit, 256-kilobit, 1-megabit, 2-megabit, and 4-megabit densities.

All Ramtron F-RAM products have three distinct properties that make it superior to other nonvolatile memory technologies:

Fast Write Speed from F-RAM Fast write speed

F-RAM performs read and write operations at the same speed. Because F-RAM writes data at bus speed, there are no delays before the written data becomes nonvolatile. Floating gate memories have long write delays of 5 milliseconds. F-RAM writes in nanoseconds, essential in applications like auto safety systems.

High Endurance from F-RAM High endurance

F-RAM offers virtually unlimited write endurance, which means it doesn’t wear out like other nonvolatile memory devices. Floating gate devices experience a hard failure and stop writing in as little as 1E5 cycles, making them unsuitable for high-endurance applications.
 

westaust55

Moderator
You should note that the PEEK and POKE commands access FSRs which are SRAM. This means that they have an unlimited read-write endurance - they do not access the Flash program memory which, as you have pointed out, has a limited endurance.

READ and WRITE commands write to the non-volatile EEPROM on the chip which usually had a rated endurance of 10 million cycles.

Also, if I recall correctly, the endurance of EEPROM (of which Flash is a type, but is usually erased and written in blocks, instead of individual bytes) is usually conted by erase-write cycles, not read.

ylp88

From the PIC datasheets for several PICs and also the Micrcochip 24LCxxx series EEPROM:

• High Endurance Flash/EEPROM Cell:
- 100,000 write Flash endurance
- 1,000,000 write EEPROM endurance
 

ylp88

Senior Member
It might also be worth mentioning that EEPROM endurance is also strongly affected by operating voltage and temperature, which may or may not be controllable depending on the specific application.

From the PIC datasheets for several PICs and also the Micrcochip 24LCxxx series EEPROM:

• High Endurance Flash/EEPROM Cell:
- 100,000 write Flash endurance
- 1,000,000 write EEPROM endurance
oops... If I had bothered to re-read that I should have caught that! 10M? Awesome!! :D Thanks for correcting me there.

FRAM is great and works - I have bought several.

The issue for many is the price which is considerabily more per byte than for EEPROM memory.
Aside from FRAM, I've noticed that Microchip has started selling serial-SRAMs (not a new idea, but now I have a source for them!). Not the same, but still overcomes a lot of the limitations of EEPROM in logging/shuffling applications while maintaining pin-compatibility at 3.3V and lower specifications. They also have data retention down to 1.2V with uA stand-by current which is great for single-cell and low power applications. They are also only a bit more that US$1 a piece and will certainly be on my next order to Microchip!

With an endurance of 10 mil cycles for the eeprom I could peek and poke once every 2 minutes for 20 years.
I might just note again that accessing the (write-cycle limited) EEPROM is performed using the READ and WRITE commands, not the PEEK and POKE commands. As mentioned above, refer to this thread for a summary.

ylp88
 

westaust55

Moderator
I've noticed that Microchip has started selling serial-SRAMs (not a new idea, but now I have a source for them!). Not the same, but still overcomes a lot of the limitations of EEPROM in logging/shuffling applications while maintaining pin-compatibility at 3.3V and lower specifications. They also have data retention down to 1.2V with uA stand-by current which is great for single-cell and low power applications. They are also only a bit more that US$1 a piece and will certainly be on my next order to Microchip!

Yes, I have seen those as well on the microchip website.

They are SPI interface not i2c but will still work with PICAXE chips.
You potentially need 4 signals:
- Clock
- Serial In
- Serial Out
- Chip select (could be tied if only using one SPI device)

So 1.5 or 2 times as many lines/signals required as an i2c device.
 

Dippy

Moderator
I agree with WestAust, except for one thing...

FRAM is great and works - I have bought several thousand.

Just be aware that the transfer to FRAM (or any memory) will incurr a time overhead, so you will NOT get magic superfast data storage - but faster than normal EEPROM. And far more durable than standard EEPROM or Flash.

I notice a recent thread about timing. Has anyone done any Real World timing for SPI and I2C commands? And at different bus speeds?

With my work with PIC using I2C I noticed very little difference with small byte packets at different bus speeds - the reason being fairly obvious, but it's just something to remember.
 

westaust55

Moderator
I notice a recent thread about timing. Has anyone done any Real World timing for SPI and I2C commands? And at different bus speeds?
Dippy,

I did some comparisons using i2c comms versus the SPIOUT (SHIFTOUT) using a 40X1 at 4MHz and 8MHz as covered in this post:
http://www.picaxeforum.co.uk/showthread.php?p=81360

but did not try the hspiout (hshout) for dedicated SPI devices as I was considering 74HC595 versus MCP23016 chips at the time.
Would think the HSPIOUT could give faster results than SPIOUT command.



Thought Tiscando was going to use that Oscilloscope that he was buying to solve the mysteries of PICAXE BASIC command timing, the universe and everything.
 
Last edited:

KIGX

Member
I might just note again that accessing the (write-cycle limited) EEPROM is performed using the READ and WRITE commands, not the PEEK and POKE commands. As mentioned above, refer to this thread for a summary.

ylp88
ylp88,

Thanks for the correction. I had read the thread but the subtilties are obviously still escaping me. Reading, writing, poking etc., are some of my programming topics for the day. It's -16C outside so curling up with the manuals seems like a reasonable idea. I also have westaus' memory chart that I need to decipher.
 

hippy

Ex-Staff (retired)
if I set up a weather station and peek and poke data once a minute my simple math seems to imply that I'll burn out that address in 100000/60/24/2 = 35 days. That doesn't seem very practical. Even if I do it once every 10 minutes it's still only a year.
As noted above, modern Eeprom has a lifetime of 1,000,000 or more these days, often higher. You need to check the datasheet for the particular device being used.

With a 1,000,000 write lifetime, writing once a minute will give a lifetime of around 700 days, around two years. Though it's never been clear to me what this endurance relates to, single location, block or whole chip; would a 32KB chip fail after one million writes, or 32 billion writes if each location were used sequentially in turn ? I don't know.

If I burn out that address, what happens? Does the entire chip die or just that address? Can I just move on and burn out another address or do I go buy a new chip?
Hard to say and I have never seen the definitive answer anywhere. It probably depends on how the chip is constructed. You could get just one location become unreliable, a whole block, or a whole chip. It may be affected depending on whether you are always writing to the same location, within the same block or cycling through all locations. Different manufacturer's devices may fail in different ways.

If you are expecting lifetime issues, it would make sense to use external I2C Eeprom rather than the internal Eeprom of a PICAXE if it is cheaper or easier to replace the I2C chip rather than the PICAXE, or to choose something like FRAM which has a greater endurance.

Do you get any warning or is there a sudden puff of smoke as the chip goes up in flames?
Failure is probably not very dramatic in itself though the consequences could be. It depends on how the data is used after being written. What probably happens is that you get back data which is different to what was written, and that's all. If a chip ( or controlling software ) checks what is written, it could potentially lock-up while failing to verify which could cause secondary adverse effects.
 

BeanieBots

Moderator
The failure effects the physical location of the individual cells being written to. This can 'bleed through' to the next cell. It would require knowledge of the internal layout to predict the exact consequences.

"Failure" is itself ambiguous. It is not as simple as suddenly that which was written no longer comes back. At the end of the day the way EEPROM works is very similar to a capacitor holding charge. As the cell wears out, it's ability to hold the charge is reduced. At some point, it totally fails to hold any charge, however, there will be a point in between where it will 'leak'.
That means it will verify what was written at the time, but might 'forget' what was written a few months later.
 

KIGX

Member
I read the data sheet posted in post #4 by JGlenn and from what I gathered you can burn out certain locations without affecting others and how much you burn out is dependant on how you access the addresses. For example constantly accessing a single byte will wipe out a larger block because the 'voltage pump' turns on for the whole block and I guess it is the voltage pump that kills the addresses. Therefore, it seems like one could burn out a location and then move on to burning out another one.

I suspect Hippy is right and some day you find corrupted data. Since I'm building a for-fun weather station and not a space station I can probably deal with a bit of nonsense data as a wake-up call.

I'm still a rookie PICaxer so I'll stick with onboard memory for now. Right now I'm trying to figure out where I can PEEK and POKE my 08M without crashing my program. I'm using 178 bytes out of 256 but where are they? Deciphering westaust55's memory chart there's basic accessible RAM from 80 to 127, scratchpad from 0 to 127 and eeprom from 0 to 127. My understanding is the program goes into eeprom but there's only 127 bytes worth there - or is that 127 words worth? If it's 127 bytes worth, where's the program? In the scratchpad? But that's RAM not eeprom?

I guess I better go back to reading the manuals and searching threads...

Thanks

Bob
 

hippy

Ex-Staff (retired)
Program is stored in the data Eeprom of the 08M, 256 bytes worth. The space there is shared by program code and "Eeprom(...)" data ( accessed by Read and Write ).

There is also a Ram (SFR) area which includes on-chip contol registers, run-time data used by the firmware which makes it a PICAXE ands what's left can be put to your own uses; addresses $50 to $7F ( 80 to 127, accessed by Peek and Poke ).
 
Top