Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: MMC filesystem speed

2005-11-27 by Bertrik Sikken

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

seangra wrote:
> c) see if there are any simple optimizations that can be done to the
> code, or post it here and see if anyone has any ideas on how to make
> it more efficient.
> 
> It would be interesting to see what those tests show.
> 
>> My results are:
>>
>> read 13s; write single 14s; write multiple 13s
>>
>> I find it surprising that the write speed is not significantly
>> slower than the read speed.
> 
> Keep in mind the speed that you're operating at vs the maximum
> speed.  Let's say that on your card (at 7.5MHz) the write operation
> can occur at 400KB/sec, and the read operation at 800KB/sec. 
> Because your throughput is only 320KB/sec they will both appear to
> take the same amount of time.

Your were right about the optimisations and the throughput
limitations.

First of all, I realised thath the results above were obtained
with code compiled for thumb, so I changed that to arm.

Also I added a dummy write test, which basically just writes
4 million bytes of value 0xFF (a NOP command for the card).
The theoretical transfer time for sending it over a 7.5 MHz
SPI link is just 4.5 sec. However, this took 11 seconds.
It turns out that the code I was using, calls a subroutine for
every byte transfered. This subroutine selects the SPI slave
and transfers just one byte over SPI, then deselects.
I changed this to do the SPI slave (de)select only once for each
block and then transfer a block without calling any subroutines.

Finally, I tried a different memory card: an "A-DATA SD 60x 256".
This card claims 7 MB/s write speed. In my card reader, I got
3.3 MB/sec.

My results are now (seconds per 4 MB transfered):
                A-Data   Kingston
dummy             6         6
read              8         8
write single      9        10
write multi       7         8

The dummy write time is still a bit above the theoretical maximum,
but it is a large improvement over the original 11 seconds.

My conclusions so far:
* multiple block write is indeed faster than single block write
* but not by much, because most of the time is spent in SPI0 transfer
* SPI0 transfer is a bit disappointing because of the 7.5 MHz max speed.

Kind regards,
Bertrik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDigkKETD6mlrWxPURAmviAKCEUh+dk2kcgDb9MAvR7CfwGQFA/ACeK366
rkqQUkGpK9EDQlw0HF13wxc=
=Qdkc
-----END PGP SIGNATURE-----

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.