I would like to add SD card support to my application.
Good starting point should be the example.
RIght now I'm running into some confusion with naming.
On my SD Card interface I have MISO, MOSI, SCK and CS.
Tried to match with readme I would wire:
- SCK to GPIO14
- MISO to
- MOSI to
- CS to
One more question about GPIO12. This seems to be a special GPIO.
Is there a special reason to use it in your example ?
Already ran into a problem with that pin after adding an external pullup resistor.
With other words, is there a way to use other pins ?
Pins in SD Card example naming
Re: Pins in SD Card example naming
MISO, MOSI, SCK, and CS are SPI interface pins. I suppose that you are using a breakout board for an SD card designed to using the SD card in SPI mode. Current sdmmc driver in the ESP-IDF uses SD protocol to talk to the SD card, and doesn't support SPI protocol. The pins in the example are named according to the names of pins in SD protocol.
The pins of SDMMC peripheral in the ESP32 are not connected to the GPIO matrix, and can only be routed via IO MUX to these specific pins. SDMMC peripheral has two slots: a 4-bit one (HS2_* pins in esp32_chip_pin_list.pdf), the other is an 8-bit one (HS1_* pins).
This example uses the 4-bit slot. Please see the notes in the readme regarding GPIO12. I think they describe the limitations pretty well, and also give solutions for possible issues associated with this pin.
We also have a work-in-progress driver for SD cards in SPI mode. This driver can work with arbitrary pins because SPI peripheral signals can be routed via the GPIO matrix. The tradeoff is that the speed of SD card in SPI mode is slower than in SD mode. This driver will be available soon after the upcoming release (~in a couple of weeks).
The pins of SDMMC peripheral in the ESP32 are not connected to the GPIO matrix, and can only be routed via IO MUX to these specific pins. SDMMC peripheral has two slots: a 4-bit one (HS2_* pins in esp32_chip_pin_list.pdf), the other is an 8-bit one (HS1_* pins).
This example uses the 4-bit slot. Please see the notes in the readme regarding GPIO12. I think they describe the limitations pretty well, and also give solutions for possible issues associated with this pin.
We also have a work-in-progress driver for SD cards in SPI mode. This driver can work with arbitrary pins because SPI peripheral signals can be routed via the GPIO matrix. The tradeoff is that the speed of SD card in SPI mode is slower than in SD mode. This driver will be available soon after the upcoming release (~in a couple of weeks).
- Attachments
-
- microsd pinout.jpg (41.02 KiB) Viewed 5774 times
-
- Screen Shot 2017-02-17 at 18.05.40.png (94.69 KiB) Viewed 5774 times
Re: Pins in SD Card example naming
Wow, 10 minutes and response came in
I will wait for the SPI driver which will come (hopefully soon
I will wait for the SPI driver which will come (hopefully soon
Who is online
Users browsing this forum: No registered users and 35 guests