However, when testing with static voltages and without card, I see 5V at pin 2, which is out of specs, IMO.
I guess, a reverse biased diode is required between 5Vsig and the MOSI input pin.
Or at least helpful, to keep the SD pin between 3.3V (HIGH) and 0.6V (LOW)
That buffer circuit is wrong, its connecting 5V Arduino outputs to the 74HC245's inputs, shortcircuiting the outputs of the Arduino through the 74HC245's input protection diodes to 3.3V - this could damage the 74HC245, the Arduino, or raise the 3.3V rail to well above 3.3V - none of these are desirable. Basically the voltage mismatch has been moved from the SDcard to the '245
My concern is not the "how to ? " but "is it required ?"
Those modules often claim to work with an Arduino, and are equipped with a voltage converter to be fed by 5V and provide 3.3V for the SD card. So I assume they are meant for 5V signals, too.
I just see that a 5V signal ( MOSI or CLK ) shows up with 5V at the SD card pin, and I read this is beyond the specs ( 3.6V max.)
So my questions
Anyone using such a module, and how ?
Does this observed voltage drop to 3.3V with an actual card inserted ?
Doesn't it hurt, if at least Vdd is 3.3 V
Would you strongly recommend that diode, which effectively just makes a LOW signal pull down the SD pin input.
Additionally, I noticed that the CS signal is not connected to a 3.3V pullup resistor at all, on my module.
Is there a voltage divider ( either 2 resistors or a diode+pullup resistor or another voltage divider IC ) required/ recommended, if I need to use the CS pin, as there are other SPI devices on the same MISO/MOSI/CLK pins.
The point is that there is a lot of crap designes out there, so I would not take design lessons from what you see.
While they might work for a time stressing electronic components above the rated values is going to shorten there life. It is very unlikely that these designes have been tested properly.
So yes if you want a good design do it right, if not buy crap from eBay.
if you want a good design do it right, if not buy crap from eBay
I noticed that others use a 74AHC125N level shifter for all 3 input signals, and they even add an additional pullup resistor for the CS line to keep the SD card definitely inactive during bootloading via SPI.
Now that I got this module from ebay already, I'll definitely add the diodes and pullup before testing.
And consider using a level shifter IC, in the long run.
your initial post is correct. you just need to add a diode and you will not see the 5v on pin 2. The lower the forward voltage of the diode, the better. I use this method to level shift RX TX from 5v to 3.3v and it works fine as well. This is an acceptable way to level shift. For instance, Digi, which makes the XBEE modules, mentions this as one way to level shift. The other option is to disable the internal pullup resistor of the atmega output pins going into the SD card. I have not tried this with SPI, but it works fine with TWI, for which both SDA and SCL are bidirectional.
I have this exact SD card and adding a diode is all I did with input signal pins (no need to do anything to output pins) and it works perfectly fine. Just make sure you are not getting higher than 3.3.v on the input pins. What you will be stressing with the higher voltage is not the SD card module but the SD card itself.
What you will be stressing with the higher voltage is not the SD card module but the SD card itself.
Understood. Besides the 5->3.3V regulator there's not too much on the module to stress. I heard about people solder some wires directly to a microSD Adapter and use this as an interface to microSD cards.
The lower the forward voltage of the diode, the better.
There's not too much current flowing via a 10k pullup resistor and 3V, so any small signal diode ( 1N4148, about 0.6V Vf ) seems ok. Small Schottky diodes are certainly better.
Thanks Terry, for the link to a broad variety of SDFat libraries. Good to know. Thanks
michael_x:
I heard about people solder some wires directly to a microSD Adapter and use this as an interface to microSD cards.
Ah! I should have thought of that. I have a few of those adapters laying around, I'll try to wire them up. The SD card contacts are essentially the SPI pins. The genius is in the simplicity of the solution and thinking outside the box.
michael_x:
Thanks Terry, for the link to a broad variety of SDFat libraries. Good to know. Thanks
MarkT:
That buffer circuit is wrong, its connecting 5V Arduino outputs to the 74HC245's inputs, shortcircuiting the outputs of the Arduino through the 74HC245's input protection diodes to 3.3V - this could damage the 74HC245, the Arduino, or raise the 3.3V rail to well above 3.3V - none of these are desirable. Basically the voltage mismatch has been moved from the SDcard to the '245
Thanks MarkT. You just saved my toys , I was about to test this solution .