Access to files on a CF-Card with Cf_Find_File

General discussion on mikroC.
Post Reply
Author
Message
sisko
Posts: 63
Joined: 02 Jun 2005 09:48
Contact:

Access to files on a CF-Card with Cf_Find_File

#1 Post by sisko » 02 Jun 2005 10:36

Hi,
I have successfully connected a CF-Card with a PIC16F877A. This was my first test in microC 2.0.0.3:

Code: Select all

  while (CF_Detect() == 0) ;
  Delay_ms(1000);

  CF_Read_Init(528,1);
  for (i=0; i<=511; i++) {
    PORTC = CF_Read_Byte();
    Delay_ms(100);
  }
With a disk-editor I searched the starting sector of my test-MP3-file on the CF (here 528) and I could read the data of the first sector.
But now I am searching some examples for using Cf_Find_File to select a certain file on the CF by its name, determine the length of the file and read the data.

The library examples in the microC handbook only describe how to write 5 text files but not how to read them.
I know that the 16F877A has not enough RAM. Therefore tomorrow I will get the 18F452 and the 18F458 for testing.

Regards, Gunther

anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

#2 Post by anton » 02 Jun 2005 10:44

Hi sisko

mikroC doesn't support File_Open or File_Read at the moment.

The next version will support it for SD and MMC cards. But i believe they will update the CF-library soon there after :wink:
Another proud user of LV 24-33A Development System and mikroPascal PRO for dsPIC :)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)

Post Reply

Return to “mikroC General”