ivanbraga
Joined: 05 Nov 2007 Posts: 2
|
I need help with the library "MMC Over SPI FAT32" |
Posted: Mon Apr 19, 2010 12:58 am |
|
|
Sorry for the English as translated by Google.
Do not write a lot to do not be difficult to understand.
I'm trying to use the code in this topic:
http://www.ccsinfo.com/forum/viewtopic.php?t=31532
When I try to read the test file saved on SD_CARD, which receive for USART is very strange.
In the file abc.txt that is already recorded on the card, it is written (0123456790123456789 ......) and the file size is 512 bytes.
When I try to read this file get (024680246802468 .......) read with a size of 256 bytes, then it just random characters.
That is, it skips the odd numbers, as we read in 2 of 2.
Code: | strcpy(filename,"abc.txt");
f = open(filename,'r'); // open file for reading
if((f & MMC_ERROR) == 0) // No error, same as
{ // if(f < MAXFILES)
while(fgetch(&c,f) == MMC_OK)
printf(c);
fclose(f);
} |
I'm using the PIC18F2620, the compiler v4.084 and SPI_HW.
Could anyone help me solve this problem.
Thank you. |
|