SD card pin arrangement and bus read and write methods

Publisher:幸福微风Latest update time:2015-10-22 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
SD card pin definition: SD card pin function details:
  
SD card pin arrangement and bus read and write methods




 
Pin
Number
SD Mode        SPI Mode
name type describe name type describe
1 CD/DAT3 IO or PP Card detection/
data line 3
#CS I Chip Select
2 CMD PP Command/
Response
DI I data input
3 VSS1 S Power Ground VSS S Power Ground
4 VDD S power supply VDD S power supply
5 CLK I clock SCLK I clock
6 VSS2 S Power Ground VSS2 S Power Ground
7 DAT0 IO or PP Data Line 0 DO O or PP Data Output
8 DAT1 IO or PP Data line 1 RSV    
9 DAT2 IO or PP Data line 2 RSV    
 

                  Note: S: power supply  I: input O: output with push-pull drive
                      PP: input and output with push-pull drive
SD card supports two bus modes:
SD mode and SPI mode. SD mode is the standard read and write mode of SD card, but when using SD mode, it is often necessary to select an MCU with an SD card controller interface, or an additional SD card control unit must be added to support the reading and writing of SD card. However, many 51 microcontrollers do not have an integrated SD card controller interface. If SD mode communication is selected, the hardware cost of the product will be increased invisibly. In the case where the SD card data reading and writing time requirements are not very strict, the selection of SPI mode can be said to be the best solution. I used software to simulate the SPI bus timing to read and write SD card.
Among them, the SD mode uses a 6-wire system, using CLK, CMD, DAT0~DAT3 for data communication.
The SPI mode uses a 4-wire system, using CS, CLK, DataIn, and DataOut for data communication. The data transmission speed in SD mode is faster than that in SPI mode. When using a microcontroller to read and write SD card, SPI mode is generally used. Different initialization methods can make the SD card work in SD mode or SPI mode. Here we only introduce its SPI mode.
The connection diagram between the SD card and the microcontroller in SPI mode: The operating voltage range of the SD card is 2.0-3.6V . The logic level of the IO of the SD card is 3.3V. The above diagram is only suitable for the IO logic level of the microcontroller is 3.3V. If we use a 5V MCU, we have to perform level conversion. (The following method is a safer approach, and some people use resistor voltage division) There are two main principles to solve the level compatibility problem of the logic device interface: First, the minimum voltage value of the output level device outputting a high level should be greater than the minimum voltage value recognized as a high level by the receiving level device; second, the maximum voltage value of the output level device outputting a low level should be less than the maximum voltage value recognized as a low level by the receiving level device. Considering that the SD card is in the SPI protocol working mode, the communication is unidirectional, so when the microcontroller transmits data to the SD card, the transistor plus pull-up resistor method is used, and when the SD card transmits data to the microcontroller, it can be directly connected, because the level between them just meets the above-mentioned level compatibility principle, which is both economical and practical. In this way, the hardware connection is completed, pay attention to the working voltage of the SD card
  
SD card pin arrangement and bus read and write methods

 








Design of SD card reading and writing based on AT89C52 single chip microcomputer
   
Reference address:SD card pin arrangement and bus read and write methods

Previous article:Detailed analysis of the types of various IO ports of the microcontroller
Next article:Playing with MCU, you and I are both rookies (Continued 2)

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号