Pin Number |
SD 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 | |
|
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
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)
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Excellent Award-winning Works: High Power Factor Power Supply
- Download the information and get free gifts! A century of technology, a decade of disruption: How to survive in the electric vehicle revolution?
- DSP28335 R&D Notes
- A command is active and pcb cannot be saved successfully
- What is R2 used for?
- Automatic clock-in walking timing system based on face recognition
- The only one! What do you think of the Gowin μSoC FPGA with integrated Bluetooth low energy wireless transceiver? Do you want to play with it?
- [GD32L233C-START Review] 16. IIC obtains the temperature, humidity and atmospheric pressure of the x-nucleo-iks01a3 board
- Zigbee node cannot access the network?
- Selling Raspberry Pi 3b+ with 7-inch display and camera, beaglebone black, nrf52840 original development board