Mundarija:

ESP32 uchun SD interfeysini tanlang: 12 qadam (rasmlar bilan)
ESP32 uchun SD interfeysini tanlang: 12 qadam (rasmlar bilan)

Video: ESP32 uchun SD interfeysini tanlang: 12 qadam (rasmlar bilan)

Video: ESP32 uchun SD interfeysini tanlang: 12 qadam (rasmlar bilan)
Video: ESP32 Tutorial 43 - IoT Internet Weather Station | SunFounder's ESP32 IoT Learnig kit 2024, Noyabr
Anonim
ESP32 uchun SD interfeysini tanlang
ESP32 uchun SD interfeysini tanlang

Bu ko'rsatmalar ESP32 loyihangiz uchun SD -interfeysni tanlash haqida nimadir ko'rsatadi.

1 -qadam: SD interfeysi

Asl Arduino SD kutubxonasida SD Interface SD SPI avtobus uzatish rejimidan foydalanadi.

SD -da, aslida, ko'proq uzatish rejimi mavjud:

  • SPI avtobus rejimi: ESP32da 1 dan ortiq SPI avtobusi bor, uni ishga tushirish vaqtida sozlash mumkin
  • 1-bitli / 4-bitli SD-avtobus rejimi: ESP32 SD-avtobus rejimi API-ni amalga oshirish uchun boshqa SD_MMC nomli kutubxonani ajratadi.
  • SD UHS-II rejimi: ESP32 qo'llab-quvvatlanmaydi

Refer.:

www.arduino.cc/en/reference/SD

uz.wikipedia.org/wiki/SD_card

docs.espressif.com/projects/esp-idf/en/lat…

2 -qadam: ESP32 GPIO pinlarini xaritalash

Bu erda standart ESP32 GPIO pinlari xaritasi:

SD karta pin MicroSD pin Ism 4-bitli SD-avtobus 1-bitli SD-avtobus SPI avtobusi (HSPI / VSPInative pin)
1 2 D3 13 - SS (15/5)
2 3 CMD 15 15 MOSI (13/23)
3 - VSS GND GND GND
4 4 VDD 3.3V 3.3V 3.3V
5 5 CLK 14 14 SCK (14/18)
6 6 VSS GND GND GND
7 7 D0 2 2 MISO (12/19)
8 8 D1 4 - -
9 1 D2 12 - -

1-bitli / 4-bitli SD avtobusining GPIO pinlarini xaritasini o'zgartirish mumkin emas.

SD_MMC oddiy chaqiruvi boshlang'ich 4-bitli SD-avtobus rejimiga () boshlanadi:

SD_MMC.begin ();

1-bitli SD-avtobus rejimi SD_MMC begin () usulida tanlanishi mumkin, masalan.

SD_MMC.begin ("/cdcard", rost);

SPIClass namunasini yaratishda SPI avtobusini (HSPI yoki VSPI) tanlash mumkin, masalan.

SPIClass spi = SPIClass (HSPI);

Ko'rib turganingizdek, HSPI bilan 1-bitli / 4-bitli SD-shinani ulash pinlari, lekin SD-karta pinlarining xaritasi bir xil emas. Shunday qilib, agar apparat SD -kartali xaritaga muvofiq ulangan bo'lsa, u to'g'ridan -to'g'ri HSPI pinlarini ishlata olmaydi. GPIO pinlarini SPIClass begin () usulida bekor qilish mumkin, masalan.

SPIClass spi = SPIClass (HSPI);

spi.begin (14 / * SCK * /, 2 / * MISO * /, 15 / * MOSI * /, 13 / * SS * /);

Bundan tashqari, SD kutubxonasi SD start () usulida SS pinini, SPI avtobusini va avtobus chastotasini bekor qilishi mumkin.

SD.begin (13 / * SS * /, spi, 80000000);

3-qadam: SD-ni tortib olish talablari

Agar siz 4-bitli SD-avtobus rejimidan foydalanmoqchi bo'lsangiz, ESP32 SD-ni tortib olish talablariga rioya qiling, ayniqsa:

  • GPIO13-dagi tortishuvlar
  • DAT2 da Bootstrap va SDIO o'rtasidagi ziddiyatlar

Refer.:

docs.espressif.com/projects/esp-idf/en/lat…

4 -qadam: Har xil apparat

Har xil uskuna
Har xil uskuna

ESP32-da tonna dev to'plami va dev taxtasi bor, ularning ba'zilari o'rnatilgan MicroSD karta uyasi.

Mana mening qo'limda bir nechta misol:

  • TTGO T-Watch, 1-bitli SD-avtobus rejimiga muvofiq GPIO pinlariga 2, 13, 14 va 15 ga ulangan, shuning uchun u 1-bitli SD-avtobus rejimi va SPI-avtobus rejimidan foydalanishi mumkin.
  • M5Stack Series, u GPIO pinlariga 4, 18, 19 va 23 ga VSPI mahalliy pinlariga ulangan, shuning uchun standart SD kutubxona sozlamalarini ishlatishi mumkin [SD.begin (4)]
  • ODROID-GO, u 18, 19, 22 va 23-gachasi GPIO pinlariga VSPI tugmachalari bo'yicha ulangan, shuning uchun standart SD kutubxona sozlamalarini ishlatishi mumkin [SD.begin (22)]
  • ESP32-CAM, u GPIO pinlariga 2, 4, 12, 13, 14 va 15 ga 4-bitli SD-avtobus rejimiga ulangan, shuning uchun barcha 4-bitli / 1-bitli SD-avtobus rejimi va SPI-avtobus rejimidan foydalanishi mumkin.
  • TTGO T8 dev platasi, 1-bitli SD-avtobus rejimiga muvofiq GPIO 2, 13, 14 va 15-pinlariga ulangan, shuning uchun 1-bitli SD-avtobus rejimi va SPI-avtobus rejimidan foydalanish mumkin.

www.lilygo.cn/prod_view.aspx?Id=1123

docs.m5stack.com/

wiki.odroid.com/odroid_go/odroid_go

wiki.ai-thinker.com/esp32-cam

github.com/LilyGO/TTGO-T8-ESP32

5 -qadam: SD -karta uyasi uzilish taxtasi

SD -karta uyasi uzilish taxtasi
SD -karta uyasi uzilish taxtasi
SD -karta uyasi uzilish taxtasi
SD -karta uyasi uzilish taxtasi

O'rnatilgan MicroSD karta uyasi bilan jihozlangan karta barcha pinlarni ulamasligi mumkin va ko'pchilik 4-bitli SD-avtobus rejimidan foydalana olmaydi. Shaxsiy SD -karta uyasi kesish taxtasi yaxshiroq moslashuvchanlikni ta'minlaydi.

Shu bilan birga, ko'pgina LCD displeylar to'liq o'lchamli SD -karta uyasini buzadi. Biroq, ularning ko'pchiligi faqat SPI rejimi pinlarini sindirishadi. 4-bitli SD-avtobus rejimidan foydalanishning o'zi etarli emas, lekin siz ushbu ulanish xaritasi orqali 1-bitli SD-avtobus rejimidan foydalanishingiz mumkin:

LCD -> ESP32

SD_CS -> nol SD_MOSI -> 15 SD_MISO -> 2 SD_SCK -> 14

6 -qadam: GPIO 2 dasturini ajratib oling

GPIO 2 dasturini ajratib oling
GPIO 2 dasturini ajratib oling

4-bitli SD-avtobus rejimining ulanishi ESP32-ni dastur rejimiga kirishiga olib keldi. Iltimos, yangi dasturni yuklashdan oldin DAT0 SD karta uyasi GPIO 2 -ni ajratib oling.

7 -qadam: Benchmark

Benchmark
Benchmark
Benchmark
Benchmark

Men benchmark uchun oddiy Arduino dasturini yozdim:

github.com/moononournation/ESP32_SD_Benchm…

Bu erda benchmark uchun uskunalar:

ESP32

NodeMCU ESP32-32S V1.1 (WROOM-32)

SD -karta uyasi

MicroSD karta uyasi uchun ajratish paneli

SD -karta

Menda SanDisk 8 GB MicroSD va eski 128 MB MicroSD bor.

8-qadam: SD_MMC 4 bitli rejim benchmarki

SanDisk 8 Gb MicroSD

20: 27: 46.000 -> Test yozish /test_1k.bin

20: 27: 59.399 -> Ishlatilgan fayl: 13404 ms, 312.914368 KB/s 20: 27: 59.399 -> Test test /kt_2k.bin 20: 28: 17.248 -> Ishlatilgan faylni yozish: 17834 ms, 235.185822 KB/s 20: 28: 17.248 -> Test yozish /test_4k.bin 20: 28: 21.122 -> Ishlatilgan fayl: 3873 ms, 1082.959961 KB /s 20: 28: 21.122 -> Test yozish /test_8k.bin 20: 28: 23.147 -> Ishlatilgan yozish fayli: 2024 ms, 2072.284668 KB/s 20: 28: 23.147 -> Test testi /test_16k.bin 20: 28: 27.237 -> Ishlatilgan faylni yozish: 4097 ms, 1023.750061 KB/s 20: 28: 27.237 -> Test yozish /test_32k.bin 20: 28: 30.088 -> Ishlatilgan faylni yozish: 2842 ms, 1475.828247 KB /s 20: 28: 30.088 -> Test test /test_64k.bin 20: 28: 31.882 -> Ishlatilgan faylni yozish: 1811 milodiy, 2316.015381 KB /s 20: 28: 31.882 -> Sinov o'qilishi /test_1k.bin 20: 28: 35.422 -> Ishlatilgan faylni o'qish: 3520 ms, 1191.563599 KB /s 20: 28: 35.422 -> Test o'qish /test_2k.bin 20: 28: 38.813 -> Ishlatilgan faylni o'qish: 3389 ms, 1237.622925 KB/s 20: 28: 38.813 -> Test o'qildi /test_4k.bin 20: 28: 42.273 -> Ishlatilgan faylni o'qish: 3474 ms, 1207.341431 KB/s 20:28: 42.273 -> Test o'qish /test_8k.bin 20: 28: 45.752 - > Ishlatilgan faylni o'qish: 3487 ms, 1202.840210 KB/s 20: 28: 45.752 -> Test o'qish /test_16k.bin 20: 28: 48.988 -> Ishlatilgan faylni o'qish: 3213 ms, 1305.416748 KB/s 20: 28: 48.988 -> Test /read_test_32k.bin 20: 28: 52.077 -> Ishlatilgan faylni o'qish: 3093 ms, 1356.063354 KB /s 20: 28: 52.077 -> Test /read_test_64k.bin 20: 28: 55.141 -> Ishlatilgan faylni o'qish: 3080 ms, 1361.786987 KB/s

Eski 128 MB MicroSD

20: 30: 43.309 -> E (274) sdmmc_sd: sdmmc_check_scr: send_scr 0x109 qaytdi

20: 30: 43.309 -> Kartaga ulanish muvaffaqiyatsiz tugadi

9-qadam: SD_MMC 1-bitli rejim benchmarki

SanDisk 8 Gb MicroSD

20: 31: 45.194 -> Test yozish /test_1k.bin

20: 31: 59.506 -> Ishlatilgan fayl: 14325 ms, 292.796082 KB/s 20: 31: 59.506 -> Test test /kt_2k.bin 20: 32: 17.686 -> Ishlatilgan faylni yozish: 18163 ms, 230.925735 KB/s 20: 32: 17.686 -> Test yozish /test_4k.bin 20: 32: 21.291 -> Ishlatilgan faylni yozish: 3611 ms, 1161.535278 KB /s 20: 32: 21.291 -> Test yozish /test_8k.bin 20: 32: 23.939 -> Ishlatilgan fayl: 2652 ms, 1581.562622 KB/s 20: 32: 23.939 -> Test testi /test_16k.bin 20: 32: 28.397 -> Ishlatilgan faylni yozish: 4448 ms, 942.964050 KB/s 20: 32: 28.397 -> Test yozish /test_32k.bin 20: 32: 31.835 -> Ishlatilgan faylni yozish: 3429 ms, 1223.185791 KB /s 20: 32: 31.835 -> Test test /test_64k.bin 20: 32: 33.882 -> Ishlatilgan faylni yozish: 2058 ms, 2038.048584 KB /s 20: 32: 33.882 -> Sinov o'qilishi /test_1k.bin 20: 32: 38.031 -> Ishlatilgan faylni o'qish: 4146 ms, 1011.650757 KB /s 20: 32: 38.031 -> Test o'qish /test_2k.bin 20: 32: 42.062 -> Ishlatilgan faylni o'qish: 4019 ms, 1043.618774 KB/s 20: 32: 42.062 -> Test o'qish /test_4k.bin 20: 32: 46.170 -> Ishlatilgan faylni o'qish: 4106 ms, 1021.506104 KB/s 20:32: 46.170 -> Test o'qildi /test_8k.bin 20: 32: 50.288 -> Ishlatilgan faylni o'qish: 4121 milodiy, 1017.787903 KB/s 20: 32: 50.288 -> Test o'qish /test_16k.bin 20: 32: 54.112 -> Ishlatilgan faylni o'qish: 3840 ms, 1092.266724 KB/s 20: 32: 54.112 -> Sinov o'qing /test_32k.bin 20: 32: 57.840 -> Ishlatilgan faylni o'qish: 3739 ms, 1121.771606 KB /s 20: 32: 57.840 -> Test o'qish /test_64k.bin 20: 33: 01.568 -> Ishlatilgan faylni o'qish: 3711 ms, 1130.235474 KB/s

Eski 128 MB MicroSD

20: 33: 27.366 -> Test yozish /test_1k.bin

20: 33: 42.386 -> Ishlatilgan fayl: 15020 ms, 279.247925 KB/s 20: 33: 42.386 -> Test test /kt_2k.bin 20: 33: 57.927 -> Ishlatilgan faylni yozish: 15515 ms, 270.338654 KB/s 20: 33: 57.927 -> Test yozish /test_4k.bin 20: 34: 13.108 -> Ishlatilgan fayl: 15195 ms, 276.031860 KB /s 20: 34: 13.108 -> Test yozish /test_8k.bin 20: 34: 28.162 -> Ishlatilgan fayl: 15048 ms, 278.728333 KB/s 20: 34: 28.162 -> Test test/test_16k.bin 20: 34: 43.287 -> Ishlatilgan faylni yozish: 15142 ms, 276.998016 KB/s 20: 34: 43.287 -> Test write /test_32k.bin 20: 34: 58.278 -> Ishlatilgan faylni yozish: 14964 ms, 280.292969 KB /s 20: 34: 58.278 -> Test test /test_64k.bin 20: 35: 13.370 -> Ishlatilgan faylni yozish: 15101 ms, 277.750092 KB /s 20: 35: 13.370 -> Sinov o'qish /test_1k.bin 20: 35: 17.563 -> Ishlatilgan faylni o'qish: 4197 ms, 999.357666 KB /s 20: 35: 17.563 -> Test o'qish /test_2k.bin 20: 35: 21.746 -> Ishlatilgan faylni o'qish: 4191 ms, 1000.788330 KB/s 20: 35: 21.746 -> Test o'qildi /test_4k.bin 20: 35: 25.942 -> Ishlatilgan faylni o'qish: 4181 ms, 1003.182007 KB/s 20:35: 25.942 -> Test o'qildi /test_8k.bin 20: 35: 30.101 -> Ishlatilgan faylni o'qish: 4176 milodiy, 1004.383118 KB/s 20: 35: 30.101 -> Test o'qish /test_16k.bin 20: 35: 34.279 -> Ishlatilgan faylni o'qish: 4174 ms, 1004.864380 KB/s 20: 35: 34.279 -> Sinov o'qing /test_32k.bin 20: 35: 38.462 -> Ishlatilgan faylni o'qish: 4173 ms, 1005.105225 KB /s 20: 35: 38.462 -> Test /read_test_64k.bin 20: 35: 42.612 -> Ishlatilgan faylni o'qish: 4173 ms, 1005.105225 KB/s

10 -qadam: HSPI Bus Benchmark -da SD SPI rejimi

SanDisk 8 Gb MicroSD

08: 41: 19.703 -> Test yozish /test_1k.bin

08: 41: 53.458 -> Ishlatilgan fayl: 33743 ms, 124.301453 KB/s 08: 41: 53.458 -> Test test /kt_2k.bin 08: 42: 10.000 -> Ishlatilgan faylni yozish: 16540 ms, 253.585495 KB/s 08: 42: 10.000 -> Test yozish /test_4k.bin 08: 42: 17.269 -> Ishlatilgan fayl: 7298 ms, 574.719666 KB /s 08: 42: 17.308 -> Test yozish /test_8k.bin 08: 42: 22.640 -> Qo'llaniladigan fayl: 5345 ms, 784.715454 KB/s 08: 42: 22.640 -> Test test yozish /test_16k.bin 08: 42: 32.285 -> Ishlatilgan faylni yozish: 9662 ms, 434.103088 KB/s 08: 42: 32.285 -> Test yozish /test_32k.bin 08: 42: 36.659 -> Ishlatilgan faylni yozish: 4355 ms, 963.100830 KB /s 08: 42: 36.659 -> Test test /test_64k.bin 08: 42: 39.594 -> Ishlatilgan faylni yozish: 2949 ms, 1422.280151 KB /s 08: 42: 39.594 -> Sinov o'qish /test_1k.bin 08: 42: 44.774 -> Ishlatilgan faylni o'qish: 5192 ms, 807.839783 KB /s 08: 42: 44.774 -> Test o'qish /test_2k.bin 08: 42: 49.969 -> Ishlatilgan faylni o'qish: 5189 ms, 808.306824 KB/s 08: 42: 49.969 -> Test test /4_kk.bin 08: 42: 55.123 -> Ishlatilgan faylni o'qish: 5161 ms, 812.692139 KB/s 08:42: 55.158 -> Test o'qish /test_8k.bin 08: 43: 00.300 -> O'qish ishlatilgan fayl: 5176 ms, 810.336914 KB/s 08: 43: 00.334 -> Test o'qildi /test_16k.bin 08: 43: 05.277 -> Ishlatilgan faylni o'qish: 4948 ms, 847.676636 KB/s 08: 43: 05.277 -> Test o'qildi /test_32k.bin 08: 43: 10.028 -> Ishlatilgan faylni o'qish: 4773 ms, 878.756348 KB /s 08: 43: 10.028 -> Test o'qildi /test_64k.bin 08: 43: 14.760 -> Ishlatilgan faylni o'qish: 4731 ms, 886.557617 KB/s

Eski 128 MB MicroSD

08: 43: 47.777 -> Test yozish /test_1k.bin

08: 44: 04.148 -> Ishlatilgan fayl: 16390 ms, 255.906281 KB/s 08: 44: 04.183 -> Test test /kt_2k.bin 08: 44: 20.648 -> Ishlatilgan faylni yozish: 16494 ms, 254.292709 KB/s 08: 44: 20.648 -> Test yozish /test_4k.bin 08: 44: 36.674 -> Ishlatilgan faylni yozish: 16001 ms, 262.127625 KB /s 08: 44: 36.674 -> Test yozish /test_8k.bin 08: 44: 52.849 -> Qo'llaniladigan fayl: 16175 ms, 259.307831 KB/s 08: 44: 52.849 -> Test test yozish /test_16k.bin 08: 45: 09.225 -> Ishlatilgan faylni yozish: 16397 ms, 255.797043 KB/s 08: 45: 09.225 -> Test write /test_32k.bin 08: 45: 25.363 -> Ishlatilgan faylni yozish: 16143 ms, 259.821838 KB /s 08: 45: 25.397 -> Test test /test_64k.bin 08: 45: 41.632 -> Ishlatilgan faylni yozish: 16263 ms, 257.904694 KB /s 08: 45: 41.632 -> Sinov o'qilishi /test_1k.bin 08: 45: 46.488 -> Ishlatilgan faylni o'qish: 4856 ms, 863.736389 KB /s 08: 45: 46.488 -> Test o'qish /test_2k.bin 08: 45: 51.332 -> Ishlatilgan faylni o'qish: 4840 ms, 866.591736 KB/s 08: 45: 51.332 -> Test o'qish /test_4k.bin 08: 45: 56.163 -> Ishlatilgan faylni o'qish: 4834 ms, 867.667358 KB/s 08:45: 56.163 -> Test o'qildi /test_8k.bin 08: 46: 00.998 -> R ishlatilgan fayl: 4827 ms, 868.925598 KB/s 08: 46: 00.998 -> Test o'qish /test_16k.bin 08: 46: 05.808 -> Ishlatilgan faylni o'qish: 4825 ms, 869.285828 KB/s 08: 46: 05.843 -> Sinov o'qish /test_32k.bin 08: 46: 10.637 -> Ishlatilgan faylni o'qish: 4824 ms, 869.466003 KB /s 08: 46: 10.637 -> Test o'qish /test_64k.bin 08: 46: 15.478 -> Ishlatilgan faylni o'qish: 4825 ms, 869.285828 KB/s

11 -qadam: VSPI Bus Benchmark -da SD SPI rejimi

SanDisk 8 Gb MicroSD

08: 54: 17.412 -> Test yozish /test_1k.bin

08: 54: 48.398 -> Ishlatilgan fayl: 30994 ms, 135.326324 KB/s 08: 54: 48.398 -> Test test /kt_2k.bin 08: 55: 06.079 -> Ishlatilgan faylni yozish: 17677 ms, 237.274658 KB/s 08: 55: 06.079 -> Test yozish /test_4k.bin 08: 55: 13.357 -> Ishlatilgan faylni yozish: 7274 ms, 576.615906 KB /s 08: 55: 13.357 -> Test yozish /test_8k.bin 08: 55: 18.691 -> Qo'llaniladigan fayl: 5323 ms, 787.958679 KB/s 08: 55: 18.691 -> Test testi /test_16k.bin 08: 55: 28.336 -> Ishlatilgan faylni yozish: 9669 ms, 433.788818 KB/s 08: 55: 28.336 -> Test write /test_32k.bin 08: 55: 32.646 -> Ishlatilgan faylni yozish: 4309 ms, 973.382202 KB /s 08: 55: 32.646 -> Test test /test_64k.bin 08: 55: 35.551 -> Ishlatilgan faylni yozish: 2915 ms, 1438.869263 KB /s 08: 55: 35.584 -> Sinov o'qilishi /test_1k.bin 08: 55: 40.745 -> Ishlatilgan faylni o'qish: 5183 ms, 809.242554 KB /s 08: 55: 40.745 -> Test o'qish /test_2k.bin 08: 55: 45.916 -> Ishlatilgan faylni o'qish: 5182 ms, 809.398682 KB/s 08: 55: 45.949 -> Test o'qildi /test_4k.bin 08: 55: 51.091 -> Ishlatilgan faylni o'qish: 5162 ms, 812.534668 KB/s 08:55: 51.091 -> Test o'qildi /test_8k.bin 08: 55: 56.257 -> O'qish ishlatilgan fayl: 5177 ms, 810.180420 KB/s 08: 55: 56.293 -> Test o'qildi /test_16k.bin 08: 56: 01.244 -> Ishlatilgan faylni o'qish: 4956 ms, 846.308289 KB/s 08: 56: 01.244 -> Test o'qildi /test_32k.bin 08: 56: 06.006 -> Ishlatilgan faylni o'qish: 4764 ms, 880.416443 KB /s 08: 56: 06.006 -> Test o'qildi /test_64k.bin 08: 56: 10.716 -> Ishlatilgan faylni o'qish: 4728 ms, 887.120117 KB/s

Eski 128 MB MicroSD

08: 51: 01.939 -> Test yozish /test_1k.bin

08: 51: 18.358 -> Ishlatilgan fayl: 16422 ms, 255.407623 KB/s 08: 51: 18.358 -> Test test /kt_2k.bin 08: 51: 34.529 -> Ishlatilgan faylni yozish: 16173 ms, 259.339874 KB/s 08: 51: 34.529 -> Test yozish /test_4k.bin 08: 51: 50.911 -> Ishlatilgan faylni yozish: 16372 ms, 256.187653 KB /s 08: 51: 50.911 -> Test yozish /test_8k.bin 08: 52: 07.056 -> Yozilgan fayl ishlatilgan: 16137 ms, 259.918457 KB/s 08: 52: 07.056 -> Test testi /test_16k.bin 08: 52: 23.383 -> Ishlatilgan faylni yozish: 16351 ms, 256.516663 KB/s 08: 52: 23.383 -> Test yozish /test_32k.bin 08: 52: 39.533 -> Ishlatilgan faylni yozish: 16128 ms, 260.063507 KB /s 08: 52: 39.533 -> Test yozish /test_64k.bin 08: 52: 55.764 -> Ishlatilgan faylni yozish: 16250 ms, 258.111023 KB /s 08: 52: 55.764 -> Sinov o'qilishi /test_1k.bin 08: 53: 00.645 -> Ishlatilgan faylni o'qish: 4855 ms, 863.914307 KB /s 08: 53: 00.645 -> Test o'qish /test_2k.bin 08: 53: 05.459 -> Ishlatilgan faylni o'qish: 4839 ms, 866.770813 KB/s 08: 53: 05.459 -> Test o'qish /test_4k.bin 08: 53: 10.306 -> Ishlatilgan faylni o'qish: 4833 ms, 867.846863 KB/s 08:53: 10.306 -> Test o'qildi /test_8k.bin 08: 53: 15.127 -> R ishlatilgan fayl: 4827 ms, 868.925598 KB/s 08: 53: 15.127 -> Test o'qildi /test_16k.bin 08: 53: 19.963 -> Ishlatilgan faylni o'qish: 4826 ms, 869.105652 KB/s 08: 53: 19.963 -> Sinov o'qish /test_32k.bin 08: 53: 24.758 -> Ishlatilgan faylni o'qish: 4824 ms, 869.466003 KB /s 08: 53: 24.792 -> Test /read_test_64k.bin 08: 53: 29.592 -> Ishlatilgan faylni o'qish: 4824 ms, 869.466003 KB/s

12 -qadam: to'plang

4-bitli SD-avtobus rejimi eng yaxshi ko'rsatkichga ega, 1-bitli SD-avtobus rejimi taxminan 20% sekinroq va SPI rejimi 50% ga yaqin. Asosiy sabablardan biri shundaki, SD_MMC protokoli qatlami hech qanday qulflashni amalga oshirmaydi, lekin SPI bajaradi. Shuningdek, 4-bitli SD-avtobus rejimida ikkita ma'lumot uzatish liniyasi mavjud, shuning uchun nazariy jihatdan tezlikni ikki baravar oshiradi. Ammo mening eski MicroSD 4-bitli SD-avtobus rejimini qo'llab-quvvatlay olmaydi.

Ko'p hollarda 1-bitli SD-avtobus rejimini tavsiya qilaman, chunki:

  • yaxshi ishlash
  • yaxshiroq SD -karta mosligi
  • bo'shashtiruvchi SD tortish talablari
  • faqat 3 ta GPIO pinlari kerak
  • kam kod konfiguratsiyasi
  • ko'p dev to'plami, dev taxtasi va kesish taxtasi bu rejimdan foydalanishi mumkin

Tavsiya: