วิธีที่ 1
ESP32DevBoard SD
GPIO14 (MTMS) ----> CLK ---- 10k pullup
GPIO 15 (MTD0) ---> CMD ---- 10k pullup
GPIO 2 --------------> D0 ---- 10k pullup (here needs the pulldown in dorder to go to download mode)
GPIO 4 --------------> D1 ---- 10k pullup** (Currently I'am not using it because 4-bit mode didn't work)
GPIO 12 (MTDI) ----> D2 ---- 10k pullup** (Currently I'am not using it because 4-bit mode didn't work)
GPIO 13 (MTCK) ---> D3 ---- 10k pullup
N/c CD
N/c WP
command :
SD.begin(2);
SD.begin(4);
ผมลองแล้วแค่ไม่ได้ใส่ 10k
ผล :
[E] [sd_diskio.cpp:99] sdSelectCard(): timeout
[E] [sd_diskio.cpp:724] sdcard_mount(): f_mount failed 0x(3)
วิธีที่ 2
SPI | MicroSD | Arduino Uno | ESP - WROOM - 02 |
SCK | SCK | 13 (SCK) | IO 14 (SCK) |
MISO | MISO | 12 (MISO) | IO 12 (MISO) |
MOSI | MOSI | 11 (MOSI) | IO 13 (MOSI) |
SS | CS | Four | IO 4 |
- | VCC | 3V 3 / 5V | 3V3 |
- | GND | GND | GND |
SD.begin(4);
ผล :
[E] [sd_diskio.cpp:99] sdSelectCard(): timeout
[E] [sd_diskio.cpp:724] sdcard_mount(): f_mount failed 0x(3)
ช่วยแนะนำหน่อยครับ ผมลองทั้ง 5V 3v3 ก็ยังไม่ได้
ถ้าเป็น โมดูล sd card ไม่ต้องต่อ R เพราะมีในโมดูลอยู่แล้ว ลองเช็คตามนี้ครับ
https://github.com/espressif/arduino-esp32/tree/master/libraries/SD
https://www.esp32.com/viewtopic.php?t=1080
โมดูล sd card ถ้ามี arduino uno ลองใช้ทดลองกับ sd card เพื่อเช็คได้ครับ
ลองเช็คที่ขาตำแหน่งในรูป อาจจะเป็นคนละขากับบนบอร์ด
- Warning: Some ESP32 modules have different pinouts!
* Connect the SD card to the following pins:
*
* SD Card | ESP32
* D2 -
* D3 SS
* CMD MOSI
* VSS GND
* VDD 3.3V
* CLK SCK
* VSS GND
* D0 MISO
* D1 -
*/
Do I need any additional modules, like Arduino SD module?
- No, just wire your SD card directly to ESP32.
What is the difference between SD and SD_MMC libraries?
- SD runs on SPI, and SD_MMC uses the SDMMC hardware bus on the ESP32.
Can I change the CS pin?
- Yes, just use: SD.begin(CSpin)
หรือถ้ายังไม่ได้อาจจะต้องหาข้อมูลเพิ่มอีกที ได้ผลยังไงแชร์ด้วยนะครับ