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

Toggle CS for every SD command?

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



Joined: 22 May 2006
Posts: 9

View user's profile Send private message

Toggle CS for every SD command?
PostPosted: Sun Jun 04, 2006 8:10 am     Reply with quote

Is it necessary to toggle the CS line before every command sent to an SD card? My interpretation of the specification is that it should be, however many of the examples given on this forum only seem to set CS high and then low prior to the software reset command (CMD0). I understand that this is a requirement in order to set the card in SPI mode.

Initially I thought that MMC (which is what most of the examples I have seen are for) did not require the card select toggle, but I implemented a system with a PIC18F2550 and SanDisk SD card and it doesn't seem to matter whether CS is toggled or not (except for prior to CMD0).

So if it works anyway, why do I ask? My system needs to be able to work with as many types/brands of SD cards as possible, just because the SanDisk card I am using works doesn't mean others will. I can't find anywhere in the specification how long the CS line should be held high for prior to a command.

Also, has anyone had a look at the legalities of posting code for interfacing with SD cards (I am assuming the SDA doesn't allow this?).

Matt
Guest








PostPosted: Sun Jun 04, 2006 3:02 pm     Reply with quote

I would assume so, otherwise it would be hard/impossible to use multiple devices on the SPI bus. I toggle the CS line for every command in my projects.
Guest








PostPosted: Sun Jun 04, 2006 8:26 pm     Reply with quote

Have you (or someone in your company) signed any NDA? If not, you can post it... IANAL, of course.
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