Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Ward's Content

There have been 1 items by Ward (Search limited from 19-April 23)


By content type

See this member's

Sort by                Order  

#40774 Netduino Plus 2 microSD read metrics

Posted by Ward on 02 December 2012 - 07:46 PM in Netduino Plus 2 (and Netduino Plus 1)

In getting ready for Christmas here, I'm putting together a Netduino Plus 2 project to control an LPD8806 LED strand. Part of that is reading LED patterns off the microSD card, and out of curiosity I checked read times for a number of different block sizes. The timing code was straightforward:

static void SendFrame(object o)
{
    t1 = Microsoft.SPOT.Hardware.Utility.GetMachineTime().Ticks;
    filestream.Read(block, 0, blockSize);
    t2 = Microsoft.SPOT.Hardware.Utility.GetMachineTime().Ticks;
    Debug.Print((t2 - t1).ToString());
    spi.Write(block);
    if (filestream.Position >= filestream.Length)
    {
        filestream.Seek(0, 0); //rewind the file
        Debug.Print("File end!");
    }
}

The test candidate was a 173 kByte file on a Transcend 2 gig microSD card, and each test case loops through the file 5-6 times. Trying a few block sizes, I found the following:

Block Size   Time (us)  Time/byte (us)  kBytes/sec
511          3218.48    6.30            158.770
512          3249.21    6.35            157.577
723          4524.63    6.26            159.792
1024         6326.45    6.18            161.860
2048         12551.00   6.13            163.174
4096         24678.56   6.03            165.974

Note that these are aggregate numbers, the actual value for each read was very bimodal for the smaller blocks, with minimum read times of around 1.07ms and maximum read times of 13.46 ms/block. The 4096 byte block read time was very consistent, at 24.93ms per block, with the first read always coming in at half that.




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.