Hello!! Everyone i am using Arduino Mega and SDFat library available from this link
I have to interface two memory cards with arduino mega, as this library supports two sd card hence that is not an issue i think.
I am having two memory cards, one is of 2GB (FAT16) and another one is of 4GB(FAT32).
I have to calculate the card size and free space available in card, i done both of the parts and both are working fine, just one issue is the speed.
Reading Card size is okay, and is fast enough, but when tried reading the free space from the card it takes 500 msec for the 2GB card but 19 Seconds for the 4GB card, both cards are of Sandisk and formatted properly.
Is there some method to speed up this, as 19 seconds is huge.
freeSpace = intVolume.freeClusterCount(); // returns number of free cluster in SD Card
freeSpace = freeSpace * intVolume.blocksPerCluster(); // blocksPerCluster() returns no. of blocks in a cluster
freeSpace = freeSpace * 512.0; // 1 block = 512 bytes
freeSpace variable is of type float and the last value contains free space in Bytes.