View previous topic :: View next topic |
Author |
Message |
prometyus2010
Joined: 12 Feb 2012 Posts: 7
|
fat32 |
Posted: Sun Feb 12, 2012 2:15 pm |
|
|
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
|
|
Posted: Sun Feb 12, 2012 2:17 pm |
|
|
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
|
|
Posted: Sun Feb 12, 2012 3:16 pm |
|
|
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
|
|
Posted: Sun Feb 12, 2012 3:19 pm |
|
|
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
|
|
Posted: Sun Feb 12, 2012 3:24 pm |
|
|
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
|
|
Posted: Mon Feb 13, 2012 10:03 am |
|
|
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
|
|
Posted: Mon Feb 13, 2012 10:36 am |
|
|
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
|
|
Posted: Tue Feb 14, 2012 9:23 am |
|
|
hi
I checked hardware and sd card but nothing wrong.
mmcsd init ok but fat init wrong. |
|
|
prometyus2010
Joined: 12 Feb 2012 Posts: 7
|
|
Posted: Sat Feb 18, 2012 1:49 am |
|
|
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
|
|
Posted: Sat Feb 18, 2012 3:39 am |
|
|
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!! |
|
|
|