Stm32 SD Card

Source: Internet
Author: User

Capacity Class

SD capacity 8MB, 16MB, 32MB, 64MB, 128MB, 256MB, 512MB, 1GB, 2GB
SDHC capacity 2GB, 4GB, 8GB, 16GB, 32GB
SDXC capacity 32GB, 48GB, 64GB, 128GB, 256GB, 512GB, 1TB, 2TB

SD Card Register

command Format

All commands are in this format, with a total of 48 digits. One starting bit, One Direction bit, 6 command bits, 32 bit parameters (some commands required), CRC 7 bit check, 1 stop bit

Command Classes

Note: Command detailed explanation see SD Card 2.0 protocol

Partial Command

Answer
There are a variety of answer formats, with R1 examples

initialization Process
Example in SPI mode

Typical initialization process

1. Enable SPI clock
2. Enable Gpio port Clock
3. Initialize GPIO, configure pin mode
4. Initialize the SPI
5. Enable SPI
6.SPI Read and write data

7. Power-on delay (>74 CLK)
8. Reset Card (CMD0), enter idle state
9. Send CMD8 to check if 2.0 protocol is supported
10. Cancel the chip selection, send more than 8 CLK, end initialization
11. Read and Write Data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.