SDCard frequency configure on ESP32 using SPI interface.

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
water
Posts: 75
Joined: Sun Sep 24, 2017 9:16 am

SDCard frequency configure on ESP32 using SPI interface.

Post by water » Tue Jun 29, 2021 8:29 pm

I try to configure SDCard frequency (use SPI interface) and measure SPI2-SCK(GPIO-18) frequency via oscilloscope, results below:

Code: Select all

sd = SDCard(slot = 2, sck = Pin(18), miso = Pin(19), mosi = Pin(23), cs = Pin(15), freq = 20000000)
20MHz

Code: Select all

sd = SDCard(slot = 2, sck = Pin(18), miso = Pin(19), mosi = Pin(23), cs = Pin(15), freq = 40000000)
40MHz

Code: Select all

sd = SDCard(slot = 2, sck = Pin(18), miso = Pin(19), mosi = Pin(23), cs = Pin(15), freq = 10000000)
400KHz

Code: Select all

sd = SDCard(slot = 2, sck = Pin(18), miso = Pin(19), mosi = Pin(23), cs = Pin(15), freq = 1000000)
400KHz
It seems all value specific will configure SPI-SCK to 400KHz except 20MHz and 40MHz, which frequency value available except above?

Post Reply