Re: Datalogger with Flash



"Mark Borgerson" <mborgerson.at.comcast.net> wrote in message
news:MPG.1e81533d22b13be498a17b@xxxxxxxxxxxxxxxxxxxxxxxxx
In article <MeSdnbvMS8UFOorZRVn-iA@xxxxxxxxxxxxxxx>,
donald@xxxxxxxxxxxxxxxx says...
peres wrote:
Hi, I have a datalogger with an eeprom memory, and i want to upgrade
it
to a serial flash memory.
the problem is that when the memory is full it will start writing at
the begining of the memory, and thats ok with the eeprom, but with the
flash i will have to erase the whole block, so that its not ok.
the message that im writing its 16 Bytes Long. anyone can help me with
that?

Thank you!

If your moving up to a flash part, your increasing your memory size
by leaps and bounds. 2 times, 8 times, 1,000,000 times.

Write your code with the erase block size in mind.

Keep two blocks available, and erase the oldest block.

Which device are you looking at using.

The Atmel devices have 256 to 1024 byte blocks.

You are already over writting 16 bytes in a full eeprom.

Good Luck


I handled a similar problem with a logging instrument using am
8 MByte Atmel data flash by:

1. using the onboard 1Kbyte+ (data block size) buffers.
2. Having the data storage wrap around at the end of flash.
That way you lost the oldest data, but kept the most
recent megabyte.
3. Using the extra bytes in the block (1024 data, about 32
'extra' bytes) to keep track of the date and time that
the block was written, as well as some other session
data. It was simpler than implementing a DOS-type
directory system and wear leveling. (or so I thought
at the time. With the availability of Lewin's
DOSFS and cheap SD cards, I'm reconsidering for my
next project).

There aren't any 'extra' bytes! They are for error correction codes (ECC) to
correct small numbers of bit errors in the sectors. The devices are not very
reliable - sectors fail or go bad and this situation needs to be detected
and allowed for.

The problem with this scheme is that you will potentially lose
data in the buffer if you lose power. I handled this with
a backup battery and power supply switcher. If the
main power dropped out, I wrote the data and went to sleep.

Peter


.