SD卡的 SPI Mode介绍

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
毕设 业计 (20 届) SD卡存储系统的设计 所在学院 专业班级 电子信息工程 学生姓名 学号 指导教师 职称 完成日期 年 月 摘 要 近年来, SD存储卡在嵌入式产品中的应用越来越广泛, 但SD卡接口一般仅集成在32位高端处理器中, 一般51单片机则由于资源限制没有该接口。因此,如何解决51单片机应用系统存取SD卡大 容量数据就显得很有实际意义。 本系统使用STC12C5A60S2作为单片机与SD卡的接口芯片, 采用SPI串行方式对SD卡的扇区进行读写,读写过程和结果通过串口调试助手在主机上显 示。本论文的核心主要从硬件设计和软件编程两个大的方面介绍了系统的实现。硬件电 路设计主要包括STC12C5A60S2最小系统电路、电源电路、串口电路、SD卡接口电路。程 序采用C语言在Keil软件下进行编写、调试,程序主要包括SD卡扇区读写程序、FAT文件 系统、串口程序等软件模块。系统实现了对SD卡扇区的读写,并支持FAT文件系统达到了 设计的要求和目的。 关键字:STC12C5A60S2,SD卡,Keil ABSTRACT In recent years, SD memory card applications in the embedded products more widely, but generally only the integrated SD card interface in 32-bit high-end processor, microcontroller 51 is generally not the interface due to resource constraints. Therefore, how to solve the 51 SCM applications to access data on large-capacity SD cards seem very practical. The system uses STC12C5A60S2 as SCM and SD card interface chip, using SPI mode on the SD card serial read and write sectors, reading and writing process and results through the serial port on the host display debugging assistant. The core of this thesis, the main hardware and software design introduces two major aspects of the system implementation. Hardware design includes STC12C5A60S2 minimum system circuit, power circuit, the serial port circuitry, SD card interface circuit. Program using C language under the Keil software write, debug, the program includes reading, FAT file system and writing SD card sector program, serial procedures of software modules. System realizes the SD card read write and sectors, and supports the FAT file system, meets the design requirements and objectives. Key Words:STC12C5A60S2,SD Card,Keil 目 录 1 引言 1 2 系统方案 3 3 系统硬件设计 4 3.1 系统硬件平台组成 4 3.2 电源模块 4 3.3 STC12C5A60S2单片机最小系统 5 3.3.1 STC12C5A60S2 5 3.3.2 时钟复位电路 6 3.4 SD卡电路设计 7 3.4.1通讯模式选择 7 3.4.2 电平匹配 7 3.4.3 硬件接口设计 8 3.5 串口电路设计 9 4 软件设计 10 4.1 主程序 10 4.2 SD卡的扇区读写 10 4.2.1 模拟SPI协议 11 4.2.2 SD卡命令格式 11 4.2.3 SD卡的复位及初始化 12 4.2.4 数据块的读写 15 4.3 FAT文件系统 19 4.3.1文件系统初始化 20 4.3.2打开文件 21 4.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值