CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

I need help with the library "MMC Over SPI FAT32"

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ivanbraga



Joined: 05 Nov 2007
Posts: 2

View user's profile Send private message

I need help with the library "MMC Over SPI FAT32"
PostPosted: Mon Apr 19, 2010 12:58 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group