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 CCS Technical Support

fat32

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



Joined: 12 Feb 2012
Posts: 7

View user's profile Send private message

fat32
PostPosted: Sun Feb 12, 2012 2:15 pm     Reply with quote

hello
I am trying to use mmcsd and fat.c pic18f4525.
If is there working fat.c library.
Please send or put this forum.
I try to modify fat.c but didn't work.
dyeatman



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

View user's profile Send private message

PostPosted: Sun Feb 12, 2012 2:17 pm     Reply with quote

Are you using a simulator or real hardware?
_________________
Google and Forum Search are some of your best tools!!!!
prometyus2010



Joined: 12 Feb 2012
Posts: 7

View user's profile Send private message

PostPosted: Sun Feb 12, 2012 3:16 pm     Reply with quote

I am using real hardware 18f4525.
sd Do pin - pic sdi C5
sd di pin - pic sdo C4
sd clk pin - pic sclk C3
sd cs pin - pic C2
dyeatman



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

View user's profile Send private message

PostPosted: Sun Feb 12, 2012 3:19 pm     Reply with quote

Look in the code library. You will find a MMC FAT32 driver and example code.
_________________
Google and Forum Search are some of your best tools!!!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Sun Feb 12, 2012 3:24 pm     Reply with quote

Repeat three times. Voltage, voltage, voltage.

To use an SD card with a PIC, you either need a 3.3v PIC, and run it at the same voltage as the card, or you need a level translator circuit between the PIC and the card.
The 4525, runs at a _minimum_ of 4.2v. Connect this directly into the SD card and you risk having blown up the card. Then data coming from the card really needs to be amplified to bring the levels up to those required by the chip.
Get the level translation working, and the supplied code works (with some bugs, particularly depending on how the card is formatted).

You need to sort out your connections.....

Best Wishes
prometyus2010



Joined: 12 Feb 2012
Posts: 7

View user's profile Send private message

PostPosted: Mon Feb 13, 2012 10:03 am     Reply with quote

My hardware I think correct because microc example working on my hardware.
But I didn't use ccs c fat 32 ex_fat example I use.
Maybe fat.c library is bug I try modify this forum.
But didn't work.
If you have correct fat.c or where can I find.
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Mon Feb 13, 2012 10:36 am     Reply with quote

No.
Seriously, you _will_ damage the PIC or the SD card 'long term' if you are directly connecting. You _must_ fix the voltage division needed to avoid this.
It _will_ cause problems. Not _may_, _will_....

Separately, the MicroC code gets away without the translation in the other direction, by using _software_ SPI. You can do this with the CCS code (need to use 'force_sw' in the SPI setup), but it kills performance.

YPYMATYC

Best Wishes
prometyus2010



Joined: 12 Feb 2012
Posts: 7

View user's profile Send private message

PostPosted: Tue Feb 14, 2012 9:23 am     Reply with quote

hi
I checked hardware and sd card but nothing wrong.
mmcsd init ok but fat init wrong.
prometyus2010



Joined: 12 Feb 2012
Posts: 7

View user's profile Send private message

PostPosted: Sat Feb 18, 2012 1:49 am     Reply with quote

hi
is anybody successful fat.c
I try everything but didn't work
I think fat.c library wrong
please help
asmallri



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

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

PostPosted: Sat Feb 18, 2012 3:39 am     Reply with quote

prometyus2010 wrote:
hi
is anybody successful fat.c
I try everything but didn't work
I think fat.c library wrong
please help


I use my own file system drivers which concurrently supports FAT16 and FAT32 so I am not familiar with the one you are using however some drivers only work for a specific format. For example, you mentioned FAT32, if you are indeed using a FAT32 driver have you checked the media is formatted for FAT32?

Generally SD/MMC media of 2G or lower are formatted to FAT16 however you can format it to FAT32 if the device you are using will let you specify the FAT to be used during the format process.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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