Re: PIC SD FAT reading speed
- From: Iwo Mergler <Iwo.Mergler@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 11 Oct 2007 15:36:04 +0100
merco wrote:
Hi,
i'm new in P18 programming,
so i'd like to know how much time does it take reading a byte from a
file (in a FAT16 SD card) with a P18 clocked at 32Mhz using libraries
provided by common languages such as C or similar.
Thank you
The first byte will take a while, successive bytes are faster.
Simplified, to get a byte from a file, you need to look into the
file directory, comparing file names, possibly following a chain
of subdirectories (which are a kind of file).
That will give you the start cluster of your file. You then have to
follow a chain of pointers in the FAT to get the actual cluster on
the disk your byte is in. Finally then need to read a whole sector
and extract your byte.
In the process you have also read the other 511 bytes of that sector,
have knowledge of the whereabouts of the other sectors of the cluster
and can, with a single step along the FAT get at the next cluster of
the file, etc.
The speed with which you can access a random byte mostly depends on
how much memory you have spare to cache directory and FAT data.
The speed you can actually communicate with the SD card is likely
to be limited by the SPI controller clock - probably 32MHz/4.
Kind regards,
Iwo
.
- References:
- PIC SD FAT reading speed
- From: merco
- PIC SD FAT reading speed
- Prev by Date: Re: OT: My letter to Ron Paul
- Next by Date: Re: OT: a rare outbreak of sanity wrt 'global warming'. Judge rules "Inconvenient Truth" is untruthful
- Previous by thread: Re: PIC SD FAT reading speed
- Next by thread: Re: PIC SD FAT reading speed
- Index(es):
Relevant Pages
|