首先说明一下,SD卡的上电过程的理解主要参考的是SD Specifications Part 1 Physical Layer Simplified Specification Version 4 .1 0 ,而这个官方文档提供了:Power Up Sequence for SD Bus Interface、Power Up Time of Host、Power Up Sequence of UHS- II Card、Power Up Sequence of UHS- II Host几个方面,而这里主要理解一下Power Up Sequence for SD Bus Interface。适当的翻译文档部分内容。
The power scheme of the SD Memory Card bus is handled locally in each SD Memory Card and in the host .
(上电过程是在sd host、sd卡内部独立处理的),之前一直以为上电是一瞬间的事情,而且没有考虑sd host、sd卡上电过程是独立的过程。
The host may reset the cards by switching the power supply off and on again. Each card shall have its own power -on detection circuitry that puts the card into a defined state after the power-on. No explicit reset signal is necessary. The cards can also be reset by sending the GO_IDLE (CMD 0 ) command.
SD卡控制器可以通过断电再上电来复位SD卡,在总线上的每个卡都有上电检测电路那样卡内部的状态机就会进入一个定义的状态(idle state),并不需要明确的复位信号,另外通过给卡发送CMD0使卡进入idle state。具体的上电过程:
这里就不再翻译了,翻译的感觉实在是太不爽了,只说一下需要注意的几点:
编程方面的初始化工作从管脚配置、上电时间、时钟频率、延时时钟几个方面来满足上面的初始化流程。
关于host提供的电压与SD卡的电压不匹配问题:摘自STM32参考手册