Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/14/05 04:03
Read: times


 
#103663 - SD card communication
Responding to: ???'s previous message
Jeff Corr said:
Do all SPI devices use this timing? I'm looking at page 99 on that datasheet at the timings used, figure
5-11


No, SPI really just defines the function of the four lines (MISO, MOSI, SCK, and CS). The actual data that gets transferred back and forth over those lines are defined by each SPI device as it sees fit.

If the commands are a single byte, and they are followed by 5 more bytes, what is contained in these 5 bytes? Parameters for the command byte?


4 bytes are parameters and the last byte is a CRC error-checking byte. This byte is only used in the first command in SPI mode (CMD0), and the CRC should be 0x95. Once CMD0 command has been executed successfuly, CRCs default to not being used in SPI mode so you can send anything you want as the last byte.

Take into consideration the reset command, there are no params, so could the remaining bytes just be low? Does that mean I still have to generate 44 clocks (40 for the bytes, plus 4 clocks, according to this figure) before the response begins to come in?


Yes, exactly. If a command doesn't have a parameter, you should "fill" those bytes with zeros.

God I'm going to have to learn to use the 8051 stack, something I've been dreading :)


Compared to some of the other things you've been expressing interest in recently, the stack should be pretty easy.

Regards,
Craig Steiner


List of 14 messages in thread
TopicAuthorDate
SDcards and filesystems            01/01/70 00:00      
   Some SD/FAT answers            01/01/70 00:00      
   no FS            01/01/70 00:00      
      Also...            01/01/70 00:00      
         Even more... anybody got any ideas?            01/01/70 00:00      
            SD command structure            01/01/70 00:00      
               datasheet            01/01/70 00:00      
                  SD card communication            01/01/70 00:00      
                     transmission block            01/01/70 00:00      
                        Push            01/01/70 00:00      
                        Won't work            01/01/70 00:00      
               CRC            01/01/70 00:00      
      Thats called a file system            01/01/70 00:00      
      Look Here            01/01/70 00:00      

Back to Subject List