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

MMC_SPI.c vs MMCSD.c

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



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

MMC_SPI.c vs MMCSD.c
PostPosted: Fri Jul 27, 2012 5:05 am     Reply with quote

Hi! I want to ask is there a difference between these 2 source files? Is there a difference if I would use mmc_spi.c or mmcsd.c?
I found ex_mmcsd, but there is nothing about mmc_spi. I`m using spi interface to communicate with the sd card. Should I have to use mmc_spi.c?
I`ll be glad if someone post an example for mmc_spi.c.
Thanks!
temtronic



Joined: 01 Jul 2010
Posts: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jul 27, 2012 5:22 am     Reply with quote

A quick look at those drivers and one appears to have more functions available though since I don't use MMS/SD cards (pita) for storage I can't comment further other than I suggest you printout the drivers and compare 'side by side' to see what is different.They are 'selfdocumented' a real bonus to say 'what does what'...

I'd highlight common code and/or functions so that whatever is left is the 'added' or 'other feature' code. Since MMC/Sd cards can be use a few ways, I'm assuming one driver is more 'flexible' than the other or better for some applications ?

hth
jay
stoyanoff



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

PostPosted: Fri Jul 27, 2012 5:28 am     Reply with quote

Look at this link
http://pinouts.ru/Memory/sdcard_pinout.shtml
The sd card could be connected in SD mode or in SPI mode.
So should I use mmcsd for SD mode and mmc_spi for SPI mode???
In the both .c files I found SPI settings, so I want to know what is the difference(if there is such).
Thanks!
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sat Jul 28, 2012 2:39 pm     Reply with quote

As Temtronic already told you the code contains comments on what each module does. Have you studied this?

Basically the two drivers have a large overlap.
Both are using SPI, not the SD-mode.
mmc_spi.c is older and well tested. mmcsd.c is newer and has a few nice additions like data buffering which makes reading and writing to the same memory page much faster and reduces memory card wearing out. mmcsd.c is however less tested, it uses the '#USE SPI' directive which had problems the last time I looked into it (v4.077).

The CCS FAT driver, fat.c, is based on mmcsd.c
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