Arduino Due freeze when a SD card is inserted

Hello everyone,

I'm facing a troubling problem on a project on a Due board (genuine). It involves a SD card on the reader of a Adafruit ADA3787 TFT breakout board (among other peripherals).

For a little insight, this project used to work on a Mega 2560 but I decided to migrate it on a Due to get more speed and RAM. I rewired my board to accomodate the different SPI pinout of the Due. The SD card reader, and the SD card, worked flawlessly on the Mega.

The problem is that the Due just stops when a card is in the slot, as soon as any attempt to communicate with the card is made via SD.begin. I can't even upload code (Nothing on the COM port) . None of the official SD of SdFat libraries exemples work at all. If I plug the card and press reset, the serial monitor shows "Initializing SD card..." and that's it.

As soon as I unplug the card, the Due resets and everything works fine again...

For the wiring , it is as SPI should be on the Due (SPI header 1 to MOSI, SPI 3 to Clock and 4 to MISO), for CS I took pin 52 (it was 10 but I changed it out of frustration).
I suspected a power issue so I powered the ADA3787 with 5V - MISO is 3.3V anyways - but nothing changed. I can't figure it out, as the mega has -it seems- less current capacity on its regulated outputs than the Due and managed to drive this card.

I searched this forum and others, in vain. If any of you has a clue of what is causing this freeze, it would be of the greatest help.

has MOSI a logic level conversion from 5 V to 3.3 V?

You might want to check this again, clock is definitely not 1

Hi Juraj,

Yes it does! The tft on the board uses it and works just fine.

Thanks for your message! Yes you're right. Clk is 3 and mosi is 1. I was mistaken in my first post but it is wired as in the schematics. I have the tft working using SPI on the same board! I'll edit the op to avoid further confusion.

MOSI is COPI and, again, it is not 1

My first step would be, remove all devices except the SD card. Use one of the examples from the SD card library.

Test the SD card with the DUE and see it the issue still exists.

This will tell you where to look next.

Sh*t. You're right. I can't beleive I've fallen for this! :sweat_smile:

Back to soldering, then! Thank you so much, you people are the best.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.