SD Card bringing the SPI bus down?

henkjan_nl
Posts: 4
Joined: Fri Jan 01, 2021 7:33 pm

SD Card bringing the SPI bus down?

Postby henkjan_nl » Fri Jan 01, 2021 7:47 pm

Hi,

I'm working on a long term home project building a handheld GPS with touch screen.

I have connected three devices joining the VSPI bus:
- 3.2" TFT screen: Chip select GPIO 5
- Resistive touch panel: Chip select GPIO 16, also using IRQ on GPIO 13
- Micro SD card (6 pin type, 3.3V): Chip select GPIO 26

They all join:
- SCK: GPIO 18
- MISO: GPIO 19
- MOSI: GPIO 23

I'm including the simple wiring diagram.

Also, I have
- a GPS with TX connectied via serial link to GPIO 4 and
- a 6-DoF accelerometer hooked up to I2C (SDA 21 / SCL 22)

I did not yet install a driver for the SD card, just for the screen and the touch panel, which work excellent.

Everything works well (see image below) until I plug in the micro SD card. As soon as I do, the screen goes white.

It seems like the SD card is pulling a lead of the SD card up or down. I don't have a signal analyzer.

I ordered the components from AliExpress:
1. MN-EH Live ESP32 Minikit: https://www.aliexpress.com/item/4000232 ... 4c4dUEGiZK
2. SD card: https://www.aliexpress.com/item/3267363 ... 4c4dL440tU
3 .Touch screen: https://www.aliexpress.com/item/3291185 ... 4c4diYw1pe
4. GPS module: https://www.aliexpress.com/item/3279686 ... 4c4d6ImvZa
5. Accelerometer: https://www.aliexpress.com/item/3270166 ... 4c4dZzrM2J

Anyone got a clue? Help is much appreciated.

Kind regards,

HenkJan van der Pol.
Wiring diagram 07 - MH-ET Live Minikit.pdf
Wiring diagram
(2.79 MiB) Downloaded 294 times
Attachments
Device working.jpg
Device without the SD Card
Device working.jpg (154.24 KiB) Viewed 3140 times

becorey
Posts: 92
Joined: Sat Mar 28, 2020 4:18 pm

Re: SD Card bringing the SPI bus down?

Postby becorey » Sat Jan 02, 2021 5:11 am

Maybe check if the SD CS pin gpio26 is low? That would select it and it would put signals on the spi bus. You said you didn't install the driver so maybe the behavior is not defined/controlled.

Also you should invest in an oscilloscope or similar if you're doing this kind of work. You can find a "mini" one for about $100

henkjan_nl
Posts: 4
Joined: Fri Jan 01, 2021 7:33 pm

Re: SD Card bringing the SPI bus down?

Postby henkjan_nl » Sun Jan 03, 2021 8:02 pm

Hi

Thanks, very helpful advice, and quite silly of me. I tried today, but I think there may be something wrong with the micro SD board itself:
  • either setting GPIO 26 high or low did not resolve the problem
  • removing the micro SD card did not resolve the problem. Since the board itself contains no active components (only 4x10k resistor and 2x capacitor) I don't think the CS pin should influence anything while the SD card is removed
  • disconnecting MOSI did not resolve the problem (either with or without the SD card)
  • after also disconnecting MISO, the screen works again
  • connecting the SD card on the TFT screen (which pops out of my housing :cry:) works flawless
Thanks also for advice on the oscilloscope. I was kind of assuming the very small devices were not usable, but it looks one could be very handy. Would a DS212 be a good option? (http://www.miniware.com.cn/product/ds21 ... cilloscope), or a DS213 (https://www.aliexpress.com/item/3264335 ... hweb201603_)?

Thanks again!

HenkJan

becorey
Posts: 92
Joined: Sat Mar 28, 2020 4:18 pm

Re: SD Card bringing the SPI bus down?

Postby becorey » Mon Jan 04, 2021 4:51 pm

I have the ds212, the ds213 looks nicer I'd go for that.

Do you have the schematic of the tft module that has the sd card? If that one is working you should be able to copy it's connections or at least find the difference.

The sd card from aliexpress, I can't see any diagram or labeled pins. Are you sure it's connected correctly?

Who is online

Users browsing this forum: No registered users and 118 guests