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

Working FAT16 or FAT32 Library needed

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



Joined: 23 Dec 2008
Posts: 83

View user's profile Send private message

Working FAT16 or FAT32 Library needed
PostPosted: Mon Jun 17, 2013 1:16 am     Reply with quote

Dear All
I am using 18F4620 clocked at 20 Mhz - Compiler Version 3.2. I am trying to work with FAT16 / FAT32 libraries posted on the forum and none of them works for me.

Hardware has no issues, since the hardware works with my previous program that writes and reads sectors using multiple block read/write command. However it works in RAW mode.

Right now, as I said I am trying to work with FAT file system and can anyone give me a link or post some source code that works for v 3.22 with 18Fxxxx please.


Thanks
Ttelmah



Joined: 11 Mar 2010
Posts: 19500

View user's profile Send private message

PostPosted: Mon Jun 17, 2013 2:34 am     Reply with quote

I'm afraid hardware...... (evil grin)

Problem is that I'd guess your 'previous program', was using _software SPI_.

The drivers from CCS, and most other sources, use the SPI hardware port.

There is a 'key difference'. The software implementation accepts a signal as 'high', if it is above 2v (on your chip, on a standard pin). The hardware interface, _requires_ the signal to go up to 4v, before it is seen as 'high'. The 3.3v SD card, can't do this without a buffer chip.

Now, they use the hardware port, since it is enormously faster (typically anything up to perhaps 30* the speed).

Look at the design her:
<www.smallridge.com.au/download/BE_Reference_Design_PIC18F4620_ENC28J60.zip>

Look at the second page, which has the SD card interface. Note the use of the 74ACT125D on the SO line. This or an equivalent is _required_ to get the hardware interface to work.

Also, as a comment, this is BrushElectronics, and his drivers are for a small fee, 'excellent', since they handle the extra complexities of SDHC as well. No connection, just a user who decided not to waste my time 're-inventing the wheel', when I went from SD to SDHC.....

Best Wishes
arunkish



Joined: 23 Dec 2008
Posts: 83

View user's profile Send private message

PostPosted: Mon Jun 17, 2013 2:53 am     Reply with quote

Thank you...

FYI, I have used Hardware SPI for my old program. I will still check with the hardware as you said. By the way can you please provide me for the working / tested code and library for Fat16 or Fat32. Compiler V 3.222, PIC18F4620
oxo



Joined: 13 Nov 2012
Posts: 219
Location: France

View user's profile Send private message

PostPosted: Mon Jun 17, 2013 3:00 am     Reply with quote

arunkish wrote:
Thank you...

FYI, I have used Hardware SPI for my old program. I will still check with the hardware as you said. By the way can you please provide me for the working / tested code and library for Fat16 or Fat32. Compiler V 3.222, PIC18F4620


http://www.smallridge.com.au/#SDUTIL
Ttelmah



Joined: 11 Mar 2010
Posts: 19500

View user's profile Send private message

PostPosted: Mon Jun 17, 2013 3:15 am     Reply with quote

Question.
How big is the SD card?.

The CCS libraries do basically work. There are problems if the card is not formatted in a rather minimal way (partial fixes for that in the group), but they do fundamentally run.
However they _only_ support SD. Probably 90+% of cards now sold, are SDHC. If the card is 4GB or larger it will be SDHC.

Unless you have a buffer on SDO though, the hardware SPI port can't work with a 4620 at 4.2v or more (which is required for 20Mhz operation). You were probably using software SPI, and not realising it.

Best Wishes
arunkish



Joined: 23 Dec 2008
Posts: 83

View user's profile Send private message

PostPosted: Mon Jun 17, 2013 8:06 am     Reply with quote

The size of the card is 2 GB.

Instead of checking it in real hardware, I am trying to compile the library and run it at least in Proteus which fails all the time. I googled and found some information about the Mikroe library, when I tried it all the functions performed well in Hardware as well as Proteus. But I don't want to use mikroe. Please advise me on the library that I can use in CCS in which at least i can create and read the contents of a file please.
arunkish



Joined: 23 Dec 2008
Posts: 83

View user's profile Send private message

PostPosted: Mon Jun 17, 2013 8:32 am     Reply with quote

I have been working with the mmcdos.c library

http://www.ccsinfo.com/forum/viewtopic.php?t=21721&highlight=mmcdos

When compiling I am getting the following error.
init_dram(); ,
set_dram_address(0);

functions are missing ???? What are they. Please advise.
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