Page 1 of 1

Flash Memory Question

Posted: Thu Oct 16, 2014 10:04 am
by MarkW
Hi All,

Looking to use some sort of non-volatile memory for data logging. There are options
like flash memory chip, SD flash card and battery backed SRAM etc....
I have never used flash memory before, so the question is this:

1. When using flash memory i have been told they can "wear" out. Since i am logging lots
of data (samples at every 500ms) i am bit worried about the wear out factor. I am also
told that for lots of writing to flash you need a data spreading algorithm etc etc. What are
the thoughts around this?
2. Using battery backed SRAM has the advantage of zero wait states on write and unlimited
endurance....better idea? (Microchip makes a 1Mbit 8 pin device)

Bit stuck in a decision paralysis about this :?

Any comments/help on this?

Thanx

Mark

Re: Flash Memory Question

Posted: Thu Oct 16, 2014 4:17 pm
by Benj
Hi Mark,

It depends what kind of write speed you need.

Writing to a file on an SD card can be very easy but there can be potential file corruption issues e.g. if removing the card during a write operation.

External flash ICs are currently very good and very cheap but the time to write to the flash plus the complications of paging / banking can be an issue. I have tried with these a few times but always end up going with something else to overcome all the issue presented. There is also the wear issue so think about how many times a location will get overwritten. 100,000 to 1,000,000 erase / write cycles are common so if you change the value in a location once every second then that equates to a lifetime of approx 27 hours which is far from ideal.

External RAM are very good and the device from microchip you mentioned is what we use as storage on our EB006 Ghost board. This is indeed great memory and you can simply throw values at it and it will cope very well at high speed. However then you have long term powering headaches to allow the data to be retained.

I would probably opt for the RAM maybe with a large cap to keep the thing temporarily powered if DC power is removed but let us know which way you decide.

A lipo battery and charging IC from Microchip could be a great way to maintain power mid term, used this setup on a couple of projects now.

Re: Flash Memory Question

Posted: Fri Oct 17, 2014 6:24 pm
by MarkW
Hi Ben,

Thanx for your reply on that.....pretty much sums it up. Think i will go with the SRAM
instead. The chip draws a very small amount of current when running on the VBAT
battery input. It actually has 2 supply pins.....one for VCC and one for VBAT.
I am going to run the VBAT on tiny Seiko lithium battery that is trickle charged
via another circuit on the board. For those interested the serial SRAM from
Microchip is the 23LCV1024, and the battery is the MS621FE, lithium re-chargeable.

There is one last question though....

What method do the USB stick manufacturers use to ensure long lifespan
of the devices, since they are also based on flash memory? Fancy data spreading
techniques?

Re: Flash Memory Question

Posted: Sat Oct 18, 2014 12:55 pm
by Benj
Hello,

This is taken from Wikipedia on USB flash drives.
Longevity

The memory in flash drives is commonly engineered with multi-level cell (MLC) based memory that is good for around 3,000-5,000 program-erase cycles,[40] but some flash drives have single-level cell (SLC) based memory that is good for around 100,000 writes.

There is virtually no limit to the number of reads from such flash memory, so a well-worn USB drive may be write-protected to help ensure the life of individual cells.

Regardless of the endurance of the memory itself, the USB connector hardware is specified to withstand only around 1,500 insert-removal cycles.[41]
The file system (FAT or NTFS) will do some of the work in ensuring that the active data gets shifted around on the drive. Plus automated tools like check disk which can automatically detect and hide bad memory sectors and exclude them from future usage. I do wonder though if regular defragging on SSD's is advised? ... Answered my own question with a Google search, you shouldn't defrag a SSD. Potentially bad news for Windows 8 users - http://www.outsidethebox.ms/why-windows ... void-this/

Re: Flash Memory Question

Posted: Sat Oct 18, 2014 2:46 pm
by dazz
Hi Benj
Re Win8, win 8 doesnt defrag ssd's it doesit another way called trim only takes a few seconds to do.

Regards
DAzz

Re: Flash Memory Question

Posted: Mon Oct 20, 2014 9:53 am
by Benj
Hi Dazz,

According to the Russian in the link Win8 does still do defrags but they are pretty much hidden from the user. Obviously I know nothing here but personally I wouldn't put it past Microsoft to purposely reduce the life span of your PC, thereby making most users who won't crack open the case and replace parts buy a complete new PC and therefore a new copy of Windows. I'm very distrustful when it comes to things like this from giants like MS.