Page 1 of 1

ESP32 Pin 12 and SPI Miso clash

Posted: Wed Jul 03, 2024 7:57 am
by Mohammad
I am running into a problem that i can't figure out and I couldn't find anything on the forum either. I am using 2 SPI (an SD card and an ADS1256 module) devices and since one has to keep collecting data I decided to use HSPI for the SD card. The problem is that the Miso of HSPI is on PIN12 which needs to be low during boot but if keep it low then the sd card will not initialize. So i put in a switch to switch between ground and MISO and it works.
I have a software which reads the serial commands and displays it using graphs. the Logic goes like this. It checks if the software is up and running by receiving a number "5" (could be anything) from the software. If the software crashes it will stop sending the number and the esp will then start saving data in the sd card. Now here comes the problem. I am using a python script which essentially does what the software has to do. But everytime i stop the script, the esp restarts. Since pin 12 is being used for Miso the esp cant reset and gives an error
rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
12:54:29.959 -> invalid header: 0xffffffff
12:54:29.993 -> invalid header: 0xffffffff
12:54:30.039 -> invalid header: 0xffffffff
12:54:30.076 -> invalid header: 0xffffffff
12:54:30.122 -> invalid header: 0xffffffff
12:54:30.158 -> invalid header: 0xffffffff
12:54:30.239 -> invalid header: 0xffffffff
12:54:30.239 -> ets Jul 29 2019 12:21:46
so everytime I have to toggle the switch which is not practical since the system will be in a remote area connected by a usb 20 meters away, so you can't just go flip the switch everytime