SD/MMC configuration problem

Status
Not open for further replies.

Raady Here

Full Member level 5
Joined
Jun 8, 2013
Messages
242
Helped
26
Reputation
52
Reaction score
26
Trophy points
28
Location
India
Visit site
Activity points
1,571
PIC18f4520, MPLAB8.8

hi,

In my SD card I need to access a txt file and a mp3 file.
First for my convenience I am trying read txt file and display on LCD.

I have configured LCd display, connections in Proteus.

I have never used Proteus before, I saw some videos online and I have placed MMC where as I can select only up to 128MB(require a 2 gb). while trying to run it asks for a image file , so downloaded Winimage tried to create .IMA file.
but in MMC card edit properties-->Card Image File while choosing the path it doesnt recognize ima file so i renamed it to .mmc

I tried to configure the SPI protocol and initialize MMC to SPI mode using the function configSPI().//used mode_00

all links that i have read leads to this page


to my understanding it asks to send commands CMD0 and some more, but how does it recognize those commands
I didnt find any file by name SD.h or sd.h in my MCC18 folder.

even I cant sort out if I am going in a right way ! any suggestions helpful.

Regards,
Raady.View attachment Project - SD&SPI.rar
 

Hello!

The best way I found was to make my own implementation of SD.h / SD.c (well, .cpp in my case).
The problem is that any code you find on the net is not safe because you don't know who wrote it
and whether it's reliable. Therefore you end up digging into the code, struggling to find out what the
author tried to do, and at the end of the day you spend more time than if you do it by yourself.

Beside this, there are many possible implementations. For a small MCU with a few K of memory,
you have to reuse the same buffers for data, tables and file records. This means that you will loose
some time re-reading the same buffers. But depending on your applications, you may want to work
a little bit faster, and therefore have one buffer for file record access, one for tables, and one for data.
This is less memory efficient but a lot faster...

So my advice: although it's usually not recommended to re-invent the wheel, you may consider
writing your own implementation of SD and FAT.

Dora.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…