 |
 |
| View previous topic :: View next topic |
| Author |
Message |
newguy
Joined: 24 Jun 2004 Posts: 1946
|
|
Posted: Wed Mar 21, 2007 10:36 am |
|
|
| Christophe wrote: | What do you actually save in that memory?
Is my application I'm going to have to save typed texts, meaning TXT - files. Can you save that on an EEPROM? How can you differ different txt files?
Can you support directories, where you can save your files into?
This smells like creating an own file system.. Is that hard? |
I save various things - text too - but the text I save always has the same length so I don't have to worry about that kind of thing. What I'm getting at is that it's always at the same location (address) in memory.
If you want to save different messages/text files to memory and you don't know how long each will be then things get a little more complex (but not much).
ASCII text can only have certain values. For instance, 0xFF or 0x00 are definitely not ASCII characters. So to mark the end of one entry, you could save 0x00 in the following address in memory. You could choose another number/value to serve as this end of message flag, but since character strings are terminated by a null (0x00) character anyway, using 0x00 makes sense.
Saving new messages to memory is quite simple: search memory for the last '0x00', and start writing from there. If the memory is initialized (defaults to) 0x00 for all locations, then all you have to do is modify your search to look for a non-zero entry followed by a 0x00 in the next address. Memories usually either default to 0x00 or 0xFF fresh out of the package. Most of the ones I've used default to 0xFF, but don't count on them being a certain value.
Erasing messages gets a little more complex. My first instinct would be to write a routine that moves/rearranges the memory contents. For instance, say you have 10 entries saved and the user wants to delete entry 3. First step is to find the beginning of entry 3 and then the beginning of entry 4. Then start moving the contents of memory beginning at entry 4 to where entry 3 'was', continuing until the end of all entries is reached. Once you reach the end, you'll have to continue overwriting until you have completely erased the old entry 10 (which is now 9, and resides lower down in memory). This sounds like a lot of work, but it's really quite trivial especially with the fast access times of an SPI FRAM device.
There are definitely other ways around this issue and each will have pros and cons depending on what it is your product should do or how it should behave. If you need more storage space than a single EEPROM can allow and if the product does require complex text file storage and retrieval, then perhaps using a memory card such as SD or MMC along with a FAT system would be preferable. It's up to you to make this call. |
|
 |
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
|
|
Posted: Thu Mar 22, 2007 2:07 am |
|
|
Thanks for the tips.
You should be able to save texts to the internal memory (I would use RAMTRON-chips) + to SD to read them in a Computer. I'm just checking out if everything is technically possible. |
|
 |
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
|
|
Posted: Thu Mar 22, 2007 6:48 am |
|
|
What if we need more memory?
The old device can save 128Kbyte on an (very big) NVRAM 431000..
What are nowadays alternatives for saving more data? |
|
 |
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
|
|
Posted: Thu Mar 29, 2007 12:42 am |
|
|
so I did some research and it appears that if you want more then 256Kbits of memory, you can use a FLASH chip. They can be interfaced via (serial) SPI, packages are SO-8.
Manufacturers are
atmel
eon silicon
macronix
sst
spansion
Anyone has some experiences with FLASH chips iso EEPROMS? |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|