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 support@ccsinfo.com

Drivers for sdhc memory cards

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



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

Drivers for sdhc memory cards
PostPosted: Tue Feb 19, 2013 7:10 am     Reply with quote

hi,

I use the sdcard drivers in picc folder quite successfully for my projects. But nowadays sdhc cards are more popular than sdcards.

I find that the sdcard drivers do not work with the sdhc cards, CRC does not get turned off during initialisation.

I have searched this forum for a solution to the problem, some members have suggested that the initialisation routines for the cards are different, whereas others have suggested that the spi mode in the sdhc card is not supported.

Please advise whether this is the case, also how do I modify the sdcard drivers to support sdhc cards (or if this is a doable solution) ?


Can the problem be in the 5v to 3.3v translation? I use resistors dividers for output lines and a ttl buffer for input. This has worked with all the sdcards I have including microSD cards but not sdhc cards, also I have not used pullups in the output lines, I make these lines high on startup through the pic.

Could this be the issue ?

thanks
a
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Tue Feb 19, 2013 9:19 am     Reply with quote

Several comments here.

There are a great many sdhc libraries around, mostly commercial. One of our forum regulars, asmallri (sp?), is one such vendor. I've not used them, but heard they're very good and worth the money.

Regarding SD vs SDHC, the difference is in how the cards are addressed. SD cards are addressed at the byte level. They use 32-bit addresses and so can only access 2^32 bytes = 4GB. SDHC cards are addressed using 32-bit block numbers, each block being 512 bytes. That means SDHC cards are limited to 2TB. The byte vs block addressing is a fundamental change that requires a complete rewrite of the driver.

Lastly, a 5V to 3.3V translation is always problematic. When I've had to interface to SD cards, I've always used a 3.3V design.
_________________
Andrew
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: Drivers for sdhc memory cards
PostPosted: Wed Feb 20, 2013 10:51 am     Reply with quote

Quote:
One of our forum regulars, asmallri (sp?), is one such vendor. I've not used them, but heard they're very good and worth the money.

I have it on good authority that his drivers are great :-)

arunb wrote:
hi,
I have searched this forum for a solution to the problem, some members have suggested that the initialisation routines for the cards are different, whereas others have suggested that the spi mode in the sdhc card is not supported.


The initializations routines ARE different. A SDHC driver will correctly initialize a stardard card but a driver written only for a standard card will not initialize an SDHC card.

The standard for SDHC has dropped SPI support as a mandatory requirement however, have tested a large number of cards from multiple vendors, I have not found any SDHC cards that do not support SPI. Most microSD vendors provide adapters to enable microSD media to be used for mini and full size SD card applications. If the microSD cards did not support SPI then these vendors would be restricting the addressable market for there cards.

Quote:
Can the problem be in the 5v to 3.3v translation? I use resistors dividers for output lines and a ttl buffer for input. This has worked with all the sdcards I have including microSD cards but not sdhc cards


No. If the hardware works for standard media then the problem is the driver.

Quote:
also I have not used pullups in the output lines, I make these lines high on startup through the pic.


You NEED a pull-up on D0.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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