SPI slave is not releasing the MISO line
Posted: Tue Sep 02, 2025 3:15 pm
Hi ESP Community,
I'm using a ESP32 WROOM 32D. I configured the SPI slave:
Thank you for your support.
Greetings
Henry
I'm using a ESP32 WROOM 32D. I configured the SPI slave:
It is working without any problems. But I want to use also some other SPI slaves (Memory, TouchPanelCtrl). These devices are working also without any problems, as long the ESP is not connected. When the ESP is on the bus, the ESP-MISO line is pulled down the level to the GND and is desurbing the communication. I measured the voltage on the ESP MISO pin and I could see, the voltage is about 0V. Even the ESP is not selected. From my point of view, the ESP MISO pin should be in the high impedance (3-state) in case the ESP-SPI is not selected. During this time it must be an input or the output is disabled. How I have to configure the MISO pin, that I can connect other SPI slaves to my master?
#define SPI_CS 5
#define SPI_MOSI 23
#define SPI_MISO 19
#define SPI_CLK 18
//Configuration for the SPI bus
spi_bus_config_t buscfg={
.mosi_io_num=SPI_MOSI,
.miso_io_num=SPI_MISO,
.sclk_io_num=SPI_CLK,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
};
//Configuration for the SPI slave interface
spi_slave_interface_config_t slvcfg={
.mode=0,
.spics_io_num=SPI_CS,
.queue_size=3,
.flags=0,
.post_setup_cb=my_post_setup_cb,
.post_trans_cb=my_post_trans_cb
};
//Enable pull-ups on SPI lines so we don't detect rogue pulses when no master is connected.
gpio_set_pull_mode(SPI_MOSI, GPIO_PULLUP_ONLY);
gpio_set_pull_mode(SPI_CLK, GPIO_PULLUP_ONLY);
gpio_set_pull_mode(SPI_CS, GPIO_PULLUP_ONLY);
// for test it was configured with pull_up and pull_down too
gpio_set_pull_mode(SPI_MISO, GPIO_FLOATING);
//Initialize SPI slave interface
ret=spi_slave_initialize(RCV_HOST, &buscfg, &slvcfg, SPI_DMA_DISABLED);
Thank you for your support.
Greetings
Henry