Can't help you with a mode; the reason why not all modules work is (to my knowledge) described in arduino uno - Slave SPI does not work - Arduino Stack Exchange
I assume you want to use the SD card with a 5 V MCU?
The Adafruit SD card adapter is good.
My understanding is that it was the early Catalex modules that didn't allow one of the lines to float. There was a thread on here, which I linked to recently, that described the simple mod to fix the issue...which was to desolder one pin and tie it to another. I haven't needed to modified my modules yet.
Delta_G:
Hmm. I was aware of the issue with the level shifter, but that post makes it sound like the other issue is with the particular card and not the module it's in. So maybe I need to just hook up what i have and try a few cards and see what happens instead of trying to engineer for it.
What I was pointing at was from the answer by Majenko ![]()
However SD cards, certainly some cheap ones, don't like to play nicely with other devices on a shared bus. Also some SD card adapters with level shifting don't play nicely.
By not playing nicely I mean tri-stating the MISO line in a timely fashion (or at all in some cases) which stops any data getting out of other devices, and can even cause damage in some cases.
The level shifter has /ENable pins for each of the four gates, and all of the /ENs are tied to ground. That means the shifter is driving MISO all the time even if the card is releasing it properly. One fix is to lift the /EN pin used on the MISO gate, and connect it instead to CS. Another fix is to cut the trace connecting the gate output to the MISO header pin, and instead connect the MISO header directly to the MISO pin on the SD holder, bypassing the shifter gate entirely. And the third option I've heard of is to just insert a 3.3K (I think) resistor in series with MISO at some point. This last option would work when the module really is supposed to be driving MISO (when the other SPI slaves have released it), and the other slaves will see it as just a pullup or pulldown resistor when they are driving MISO. Not sure it's 3.3K, but you can try different values. See the attached circuit for what the basic problem is, and the "direct connect" fix. This all applies only to microSD modules as far as I know. Most of the full size SD modules don't even have a level shifter chip, which is actually a worse problem in 5V systems.
I would be surprised if the card itself did not release MISO when its CS goes high. That's defintely part of the SD spec. But if there are such cards, then the direct connect fix would not work with them - but the other two should.
I use a 3.3 to 5V buffer on MISO in all my designs, gets that line free for sure, and keeps 5V signals off the SD card. Buffer tristated by SD's slave select signal.
Delta_G:
You mean just like a level shifter? Or something in particular?
the Nano enc28j60 Ethernet shield has the MISO problem too. but there the logic level conversion chip can be removed, because enc28j60 is 5 V tolerant.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
