Flash Memory Question

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
MarkW
Flowcode v5 User
Posts: 118
Joined: Thu Sep 17, 2009 1:30 pm
Has thanked: 3 times
Been thanked: 11 times
Contact:

Flash Memory Question

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Flash Memory Question

Post 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.

MarkW
Flowcode v5 User
Posts: 118
Joined: Thu Sep 17, 2009 1:30 pm
Has thanked: 3 times
Been thanked: 11 times
Contact:

Re: Flash Memory Question

Post 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?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Flash Memory Question

Post 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/

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: Flash Memory Question

Post 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
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Flash Memory Question

Post 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.

Post Reply