Go Down

Topic: [SOLVED] SD-card reader + USB Host Shield (Read 278 times) previous topic - next topic

StijnVerhelst

Jan 21, 2019, 10:00 am Last Edit: Jan 22, 2019, 07:13 pm by StijnVerhelst
Dear,
For my end-project for school I'm designing a baitboat for fishing. This need to use a SD-card reader module (to save the location of the boat) and a USB Host Shield (for receiving Bluetooth data from a PS3 console). The "brain" of the project are 2 ESP32's.

Parts that I'm using:
SD-card module: https://goo.gl/7rcJMh
USB Host Shield: https://goo.gl/CZ3cLj
ESP32: https://goo.gl/MUwmhM

A few weeks ago I programmed the USB Host Shield, everything worked out great and no problems.

Saturday I programmed the SD-card reader, worked also great and no problems.

Yesterday I wanted to combine those 2 programs (and also those 2 modules), wiring all OK. First of all I uploaded the code of the SD-card reader. No problem, everything worked great. BUT 1 thing I noticed: the LED of the bluetooth stick didn't light up. So I thought, maybe a wiring issue. So I dubble-checked all the wiring and everything was ok.

Then I tried to upload the code for the USB Host Shield and it failed to connect (using the board.qc file). After some troubleshooting I tried to disconnect the 5V power line for the SD-card and suddenly everything worked just fine.

So the problem is with the SD-card module. After some searching on google I found out that it's the problem of the chip of the SD-card. In particular the LVC125a. A solution for this I found here: https://forum.arduino.cc/index.php?topic=360718.0 post #8.
After carefully soldering this hack I plugged it back in and ... nothing happens. Everything works the same as before.

Does anyone know any SD-card reader that is kinda cheap but works with multiple SPI devices?

Kind regards,
Stijn Verhelst


EDIT: I've found this SD-card module on google: https://grobotronics.com/waveshare-micro-sd-storage-board.html . Would this work in combination with the USB Host Shield?

pylon

Quote
After carefully soldering this hack I plugged it back in and ... nothing happens. Everything works the same as before.
Did you adapt the fix to your board? The LVC125 is a quadruple buffer. Any of the 4 buffer can be used for MISO or CS. If your board uses another buffer than the one of the poster the solution will fail, it might even behave worse.

Quote
EDIT: I've found this SD-card module on google: https://grobotronics.com/waveshare-micro-sd-storage-board.html . Would this work in combination with the USB Host Shield?
It's much simpler (no buffer chip) so chances are higher that it will work if wired correctly. But if you fail to wire it correctly chances are much higher that you ruin some other components connect to it. As it works directly on 3V3 you must not connect and 5V device to it directly.

gbafamily

ESP32 has more than 1 SPI controller so you might connect SD reader and USB host to different controllers.

https://github.com/espressif/arduino-esp32/issues/1219

StijnVerhelst

ESP32 has more than 1 SPI controller so you might connect SD reader and USB host to different controllers.

https://github.com/espressif/arduino-esp32/issues/1219

Problem solved!
After reading this page and searching on google, I've found that SdFat does support software SPI. An example of this you can find here: https://github.com/greiman/SdFat/blob/master/examples/SoftwareSpi/SoftwareSpi.ino

Go Up