Hi,
someone who has worked on SD cards can help me out here. I just completed my FAT32 routines for microSD card. I've got little problem with calculating the free memory of the card. When I check on my PC, windowsXP shows free memory as 806.240256 MB but my function is showing 806.395904 MB.
What I'm ding here is counting all the clusters marked as free clusters starting from the root cluster and then multiplying with sectorPerCluster and bytesPerSector. The difference is exactly equal to 36 cluster memory.
I thought may be windows is removing bad clusters, so i put a check for bad clusters also and subtracted it from total free cluster count, but the result is same (the program is not able to find any bad cluster, may be since the card is new).
And since i'm counting from root cluster only, the reserved clusters are already removed from the calculation.
here is the link to the post:
Design with Microcontrollers: SD Card Interfacing with ATmega8 (FAT32 implementation)
What can be the reason for this 36 extra clusters?
(I'm also checking the total memory, which perfectly matches with what is displayed by Windows)
someone who has worked on SD cards can help me out here. I just completed my FAT32 routines for microSD card. I've got little problem with calculating the free memory of the card. When I check on my PC, windowsXP shows free memory as 806.240256 MB but my function is showing 806.395904 MB.
What I'm ding here is counting all the clusters marked as free clusters starting from the root cluster and then multiplying with sectorPerCluster and bytesPerSector. The difference is exactly equal to 36 cluster memory.
I thought may be windows is removing bad clusters, so i put a check for bad clusters also and subtracted it from total free cluster count, but the result is same (the program is not able to find any bad cluster, may be since the card is new).
And since i'm counting from root cluster only, the reserved clusters are already removed from the calculation.
here is the link to the post:
Design with Microcontrollers: SD Card Interfacing with ATmega8 (FAT32 implementation)
What can be the reason for this 36 extra clusters?
(I'm also checking the total memory, which perfectly matches with what is displayed by Windows)