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

Does SD Card library work on PIC24?

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



Joined: 27 Jul 2013
Posts: 79

View user's profile Send private message

Does SD Card library work on PIC24?
PostPosted: Mon Jul 21, 2014 2:54 pm     Reply with quote

I know that there are a lot of issues with CCS fat library.
I need to know if anyone has gotten it to work with PIC24 before I dive into it.

EDIT:
mmcsd.c works for PIC24 out of the box.
fat.c does NOT.

Compiler Version: 5.015

Thanks


Last edited by haxan7 on Wed Jul 23, 2014 1:19 pm; edited 1 time in total
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Mon Jul 21, 2014 4:13 pm     Reply with quote

It helps if you try a search first...
http://www.ccsinfo.com/forum/viewtopic.php?t=52210
_________________
Google and Forum Search are some of your best tools!!!!
haxan7



Joined: 27 Jul 2013
Posts: 79

View user's profile Send private message

PostPosted: Mon Jul 21, 2014 4:31 pm     Reply with quote

I did search and found that post, but somehow managed to miss the PIC24 part.
I also found this post that had me worrying, so I decided to create a new thread.
https://www.ccsinfo.com/forum/viewtopic.php?t=51163&highlight=fat32
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Mon Jul 21, 2014 4:46 pm     Reply with quote

An SD card library should be essentially processor independent.
As long as the clock and peripherals (SPI etc) of the PIC functions normally
the processor used should be largely irrelevant.

If they don't function correctly it's not the fault of the SDHC code.

With the posted patches I have also been able to get the
PIC24 and DsPICs 30 and 33 to work with the CCS library
so you have some choices...
_________________
Google and Forum Search are some of your best tools!!!!
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Jul 22, 2014 8:12 am     Reply with quote

dyeatman wrote:
An SD card library should be essentially processor independent.
As long as the clock and peripherals (SPI etc) of the PIC functions normally
the processor used should be largely irrelevant.


There are a couple of minor caveats that may or may not be a issue with the CCS driver (I do not know because I do not use it). Care must be taken when operating the SPI bus at higher speeds. Some PICs and/or specific hardware implementations require skew adjustment for the SPI bus to be used reliably with SD/MMC media at high clock rates.

If porting code from 8 to 16 or 32 bit processors care must be taken to avoid word alignment issues that would not be an issue with an 8 bit controller. This situation occurs with SD/MMC cards in the boot sector where some of the fields that must be processed are not word aligned.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
haxan7



Joined: 27 Jul 2013
Posts: 79

View user's profile Send private message

PostPosted: Tue Jul 22, 2014 8:51 am     Reply with quote

I am total noob, another question does Allocation unit size matter with ccs driver?
hssn601



Joined: 31 Jan 2014
Posts: 20

View user's profile Send private message

PostPosted: Wed Jul 23, 2014 3:42 am     Reply with quote

yes it works for !

I have tested SD and SDHC cards 2~16gb on PIC24f and dsPIC33E

for initialization use:

/*********************
Function: InitializeSD()
Return 1 if success
Return 0 if unsuccessful
**********************/

from this link:
http://www.ccsinfo.com/forum/viewtopic.php?p=187808#187808

after initialization rest of every thing will work ok Smile
_________________
Best Regards,
Hassan Shakeel
haxan7



Joined: 27 Jul 2013
Posts: 79

View user's profile Send private message

PostPosted: Wed Jul 23, 2014 3:45 am     Reply with quote

hssn601 wrote:
yes it works for !

I have tested SD and SDHC cards 2~16gb on PIC24f and dsPIC33E

for initialization use:

/*********************
Function: InitializeSD()
Return 1 if success
Return 0 if unsuccessful
**********************/

from this link:
http://www.ccsinfo.com/forum/viewtopic.php?p=187808#187808

after initialization rest of every thing will work ok Smile


Thanks for the reply.
Did you use fat32 file system? If yes, then did you use ccs driver as it is, or did you apply the fixes?
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