View previous topic :: View next topic |
Author |
Message |
haxan7
Joined: 27 Jul 2013 Posts: 79
|
Does SD Card library work on PIC24? |
Posted: Mon Jul 21, 2014 2:54 pm |
|
|
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: 1941 Location: Norman, OK
|
|
|
haxan7
Joined: 27 Jul 2013 Posts: 79
|
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1941 Location: Norman, OK
|
|
Posted: Mon Jul 21, 2014 4:46 pm |
|
|
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: 1636 Location: Perth, Australia
|
|
Posted: Tue Jul 22, 2014 8:12 am |
|
|
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
|
|
Posted: Tue Jul 22, 2014 8:51 am |
|
|
I am total noob, another question does Allocation unit size matter with ccs driver? |
|
|
hssn601
Joined: 31 Jan 2014 Posts: 20
|
|
Posted: Wed Jul 23, 2014 3:42 am |
|
|
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 _________________ Best Regards,
Hassan Shakeel |
|
|
haxan7
Joined: 27 Jul 2013 Posts: 79
|
|
Posted: Wed Jul 23, 2014 3:45 am |
|
|
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 |
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? |
|
|
|