Electronics > Projects, Designs, and Technical Stuff

SD card module for 5V microcontrollers - please explain this one

(1/3) > >>

Peabody:
When you look for modules for connecting standard size SD cards to microcontrollers, you find modules that look like this:

https://www.jaycar.com.au/arduino-compatible-sd-card-interface-module/p/XC4386

And notice that it says "Features 5V and 3.3V power inputs and resistors to allow safe on either IO voltage."

I think that's nonsense, and these modules should be used only with 3.3V controllers, not Arduino Unos and Nanos running at 5V.

Attached are a closeup of the module and what I believe to be its schematic.  The resistors are pullup resistors to 3.3V, but there are no series resistors or voltage dividers for the controller's three 5V SPI outputs, and their full 5V is applied to the SD card pins.  SD cards are 3.3V devices.  The module's regulator provides the correct 3.3V Vcc to the SD, but the I/O pins are blasted with 5V, which I would just guess exceeds the absolute maximum value for these pins.

If the SD card pins have protection diodes to Vcc, then current will flow out of the controller's I/O pins without limit until the output voltage drops to about 3.9V.  No telling how many milliamps that might be.  And at least in theory, remembering Dave's video on this idea, if enough current flows through the protection diodes to fully supply the power needs on the Vcc pin, voltage could continue to rise on Vcc up to 4.4V, which again would violate the absolute maximum value.  I suppose it's possible that some SD cards have 5V-tolerant pins, but I haven't seen any indication of that in datasheets.

By contrast, modules for *microSD* cards have level shifting I/Cs to deal with the 5V issue.

These full-size SD modules are widely sold everywhere and are touted as being suitable for 5V controllers.  I just don't understand how that could be.  And apparently these modules do actually work with some SD cards, at some speeds.  So what am I missing here?  If the schematic is correct, how can these work with 5V controllers?

Psi:
You could use it with a 5V ATmega using software SPI and switching between output low and input floating.

That way you would never be feeding 5V to it.
You would simply send data by toggling between low or using the 10k pullup.

The AVR IO port registers are designed so you can do this.
You set PORTA low and then just use DDRA for data,
DDRA high = output low
DDRA low  = Input float (SD card board pullup used to become 3v3 high)


I don't think there is a way to do this using hardware SPI though.

magic:
Well...

One time I accidentally supplied an SD controller with 5V instead of 3.3V and inserted a 2GB card. Both the controller and the card worked until I noticed my mistake and powered them down. They are still alive.

So my guess is that at least some cards (maybe older ones) may be tolerant (at least for some time) and that's why they sell those things and many noobs likely use them wrong by supplying full 5V but things don't blow up immediately so it's "OK".

Then somebody made a micro version and noticed that some newer cards blow up immediately so they added level shifters.

And another story: a USB card reader stopped working after a while. I took it apart and found that instead of 3.3V regulator, they used a series diode from USB 5V line to the chip's VCC, giving about 4.3V on the chip's and card's VCC. Somebody saved a penny, but it didn't last :palm:

Peabody:
Psi, do you suppose there is a library that does software SPI as you describe specifically for use with these modules?   That would be nice to have since standard-size SD modules with level shifters don't appear to be available.

magic, I guess what surprises me most is that these modules actually work some of the time.  Apparently some SD cards just tolerate the 5V with little problem, at least until the speed gets too high.

amyk:
A lot of 3.3V CMOS processes have 4.6V absolute maximum ratings. That's within -10% of 5V that, given a below-spec 5V supply and natural process variation, the device may be able to survive for some time at that voltage, but it's definitely not recommended and many will die.

(Unfortunately, the specifics of device reliability vs. supply voltage for a given process is notoriously difficult to find. Manufacturers seem to like leaving such things unsaid.)

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod