Arduino UNO 测试 SD 卡

SD 卡模块测试方法

  1. Arduino IDE 的 Library Manager 中搜索 SD,安装最新版资料库;
  2. 依次打开 File - Examples - SD - CardInfo 示例程序,Upload 至开发板;
  3. 打开串口监视器 Serial Monitor,即可看到串口信息输出,如下
Initializing SD card...Wiring is correct and a card is present.

Card type:         SD2
Clusters:          15352
Blocks x Cluster:  32
Total Blocks:      491264

Volume type is:    FAT16
Volume size (Kb):  245632
Volume size (Mb):  239
Volume size (Gb):  0.23

Files found on the card (name, date and size in bytes): 
SYSTEM~1/     2023-11-08 14:22:34
  WPSETT~1.DAT  2023-11-08 14:22:34 12
  INDEXE~1      2023-11-08 14:22:36 76

常见报错及解决办法
Could not find FAT16/FAT32 partition.
办法:
使用 SD Card Formatter 软件,对 SD 卡进行底层格式化,即选择 Overwrite formate 选项,执行 Formate 即可。

2023年11月9日更新===========
之前关于报错,通过底层格式化解决的方法需要慎用,我购买的256MB内存卡底层格式化之后,可以Arduino Uno读取初始化信息,之后重新插电脑上读取不到盘符,可能是Arduino程序有问题,将SD卡的主控烧坏,无法识别和测试SD卡;当然也有可能是这张SD卡质量问题。
因此,在不确定Arduino程序是否对SD卡有害的情况下,该报错解决方案需慎用,慎用,慎用……

posted @ 2023-11-08 14:49  无垠的广袤  阅读(38)  评论(0编辑  收藏  举报