Here are histograms of read times for a Kingston 2 GB micro SD in an Adafruit breakout.
I read a 5 MB file in chunks of 144 bytes. buf is a 144 byte array.
uint32_t m = micros();
if (file.read(buf, sizeof(buf)) != sizeof(buf)) {
error("read failed");
}
m = micros() - m;
I saved a histogram of the times in an array. Here is the result for four microsecond bins, the resolution of micros().
Bins with zero counts are suppressed.
The first value is the bin time and the second is the count of events in the bin.
under,0
108,21021
112,2391
116,1544
1184,25
1188,24
1192,217
1196,107
1200,54
1204,116
1208,563
1212,787
1216,1393
1220,687
1224,396
1228,1504
1232,855
1236,291
1240,36
1248,1
1260,1
1272,3
1276,7
1280,19
1284,24
1288,7
1292,13
1296,87
1300,78
1304,231
1308,130
1312,120
1316,185
1320,176
1324,103
1328,87
1332,113
1336,41
1340,31
1344,28
1348,38
1352,18
1356,8
1360,2
1592,18
1596,32
1600,5
1604,4
over,1101
The first three bins contain cases where the read is from cache. The timer 0 interrupt which occurs every 1028 microseconds spreads the time a bit and there is the 4 microsecond resolution of the timer.
The remainder require one or more accesses to the SD. 1101 cases took more than 1604 microseconds.
These results vary depending on whether you rerun the test after a power off and or reinit of the SD.
Here is another histogram with 12 usec bins. The first number is the start of the bin. In this case all cache reads fall into the first bin with 108, 112, and 116 usec.
Note few cases are over 1600 usec, I ran the test without powering the SD off after the above test and this changes the distribution.
under,0
108,24956
1176,31
1188,345
1200,907
1212,2848
1224,2649
1236,276
1284,3
1296,19
1308,91
1320,93
1332,83
1476,6
1488,111
1500,256
1512,912
1524,823
1536,159
1548,2
2568,4
2580,16
2592,23
2604,69
2688,2
2700,3
2772,3
2784,2
2796,11
2868,1
2880,2
2892,4
2904,11
2916,1
over,0
Access to the FAT causes the long times and the SD is quirky when reads are not sequential.
Here is a result for a 8 GB SDHC micro SD.
under,0
108,24955
120,1
1140,2
1152,13
1164,41
1176,75
1188,54
1200,263
1212,222
1224,656
1236,46
1248,40
1260,119
1272,89
1284,37
1296,20
1308,29
1320,84
1332,159
1344,1078
1356,446
1368,55
1380,251
1392,331
1404,1311
1416,1793
1428,39
1440,508
1452,96
1464,1294
1476,228
1488,51
1500,177
1512,5
1836,1
2856,1
2868,5
2880,1
2892,15
2904,1
2928,1
2940,4
2952,1
2988,2
3000,4
3012,21
3024,34
3108,4
3120,3
3132,20
3144,36
over,0