Re: Embedded w/ either SD Memory or CompactFlash



On Sun, 9 Nov 2008 10:26:33 -0800 (PST), mpm <mpmillard@xxxxxxx>
wrote:

On Nov 6, 9:21?am, J?rg Schneide <J.Schne...@xxxxxx> wrote:
mpm wrote:
[...]
So, SD just uses standard SPI, and the 4-bit version has the hoops.
Am I correct in assuming that the non-4-bit version has better
throughput?

Of course the 4 bit interface has more throughput.

Also, I'll want to write these SD cards through Windows (PC).
I assume that's no problem with the standard SPI mode.?

Has nothing to do with the SPI Mode, AFAIK.

I would do it this way: Write a prepared file with fixed name and lenght
to a fresh and empty card (they come formatted as FAT12 or FAT16) with Windows.
On your 8051: Implement a simple routine to search step by step through the boot-sector, FAT and
directory to check for existence and to get the beginning (absolute address) of the file.
It is better to place a unique byte-sequence at the beginning and check it
to be shure you got the right address.

With this offset address you can access your LUT (beginning at byte #1 of the file)
by simple adding.

Take a look at the SD-specs for the commands, up to now I have used only commands
for complete sectors (512Byte), which may be not possible in your 8051 due to limited RAM.
There are commmands for sequenced reading too if my memory is right.

Important: If you need to replace the file on the card always delete it before you write
the new one, don't allow windows to create a recycle bin folder or something.
The file may not be fragmented.

If necessary do not try to format the card in Windows file manager,
there are special Programs for that purpose.
You can use disk-editor software for formatting too
(must be capable to access sector 0 on flash cards):
Make a backup copy of the first sectors (from real sector 0 to the end of the file system)
from a fresh new card. If needed, just write it back.
Don't use such images on other card brands with the same capacity, there might be differences.

J?rg.

All good info. Thanks!!
I had not really though through all the FAT issues.
Originally, I was just going to use the physical memory address as the
counter for the location, but as you correctly indicate, you cannot
rely on Windows to put the data where you want it.

But as it turns out, this is a nice benefit.
What I will now do is bust-up the data in "chucks" and assign those
chucks in an index of sorts. The data I'm storing is actually rather
agreeable to that sort of lookup. I was going to do this anyway to
save processor cycles, but now instead of jumping to specific memory
location, I can just load the "file" instead, and search though that
file only for the data I want. Just as simple on the embedded end -
MUCH simpler on the Windows (program/update) end.!!

Also, (and I'm not sure of this yet), allowing Windows to write the SD
card might take care of writes to any bad memory bytes on the SD? If
my data is corrupted on read, or if read fails, its not the end of the
world, but if improved robustness is a consequence of allowing Windows
to "relocate" the data, all the more reason to do it that way.

Frankly, the ability to update the product by changing out the SD card
pretty much mandates Windows - unless I want to build a bunch of
specialized SD programmers too. No thanks...

-mpm

Why should that be? All of my (USB) multicard reader / writers work
flawlessly in Linux and FreeBSD.

.



Relevant Pages

  • Re: display memory extra
    ... card has 64MB video RAM, ... but not actual display memory itself...but that's just a guess there, ... actually wasn't as expected...and is why Windows still - on the ... via the device driver...and via the device driver _only_... ...
    (alt.lang.asm)
  • Re: Memories?
    ... > see the benefit from this 1/4 of 1MB increase in system memory, ... you may want to update your windows patches and/or hardware drivers ... You have a video card that allows you to see on ... You should at least turn on the built in firewall. ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Stop Errors / Blue Screen of Death (BSoD)
    ... So I ran Microsofts memory scanner/tester and nothing. ... Are these tests testing Bio/motherboard memory or just physical Ram? ... MS-MVP Windows Shell/User ... PCI card (which was installed well before the stop errors started ...
    (microsoft.public.windowsxp.configuration_manage)
  • Re: Embedded w/ either SD Memory or CompactFlash
    ... So, SD just uses standard SPI, and the 4-bit version has the hoops. ... to a fresh and empty card with Windows. ... There are commmands for sequenced reading too if my memory is right. ... If you need to replace the file on the card always delete it before you write ...
    (sci.electronics.design)
  • Re: Embedded w/ either SD Memory or CompactFlash
    ... So, SD just uses standard SPI, and the 4-bit version has the hoops. ... to a fresh and empty card with Windows. ... for complete sectors, which may be not possible in your 8051 due to limited RAM. ... If you need to replace the file on the card always delete it before you write ...
    (sci.electronics.design)

Quantcast