Go Down

Topic: SD Card Initialization Help (Read 5275 times) previous topic - next topic

Retroplayer

They are trying to tell you that the resistors are in series with the signals MOSI, SCK, and CS. This is because the arduino signals are 5V and the SD card is 3.3v. Yes, you are powering it with 5V, but there is a regulator on your module that brings it to 3.3V. That does not change the signals, though.  So some cheaper modules use resistors in series to do the level translation between the 5V and 3.3v.

They are pointing out that this may cause problems. A more correct way to do it is to use a level translator IC like a CD4050 or 74HC244.

But... on your Arduino board, I see a jumper for selecting between 3.3v and 5V MISO levels. Perhaps you need to jumper that.

SurferTim

Actually, Retroplayer, I thought that too, but it is worse than that. The schematic fat16lib posted a link to above shows those 10K resistors are pullup resistors, not in series with the inputs. The 5v outputs of the Arduino are connected directly to the 3.3v inputs of the SD card.

Retroplayer

Ahh... well, I looked at the schematic for the arduino board the OP is using and it appears that it has a level translator built in so the signals should be 3.3V. A pretty nice (but expensive board) actually.

SurferTim

I see. If the digital pins on that Mega board are 3.3v, then he is one of the lucky ones. But looking at that board, I'm not sure if it is even wired correctly for the code I would suggest.

bryant507

Sorry, my english is poor.....So..
I understand you now.
But what is OP?
Quote
I looked at the schematic for the arduino board the OP is using and it appears that it has a level translator built in so the signals should be 3.3V.

--------------------------------------------------------------------------------
Now I have two solutions if I didn't understand wrong.
1. Select 3.3v  MISO levels for the board if possible. Thus,I can get the CS,SCK,MISO,MOSI signals with 3.3V from the board.
2. Change the SD card with a level translator IC.Thus, I can convert the CS,SCK,MISO,MOSI signals from the board to 3.3V.

Am I right?Thanks a lot!


Retroplayer

That is correct.

OP means Original Poster = you.

fat16lib

There are not level shifters on this board.  The SPI signals from the processor are connected directly to the SD card.

The 10k resistors are pull-ups connected between 3.3V and each SPI line.  There is no pull-up on chip select.

The SD card will have 5V on signal lines instead of the required 3.3V signals.

Here is the correct diagram.  It will probably soon vanish from ebay.



There are many wrong circuit diagrams for this card on ebay that show voltage dividers.

bryant507

I test them with a multimeter, and find that they are all 3.3V.(MISO MOSI SCK CS)
But it is still not work.

bryant507


fat16lib

#24
Apr 02, 2013, 05:12 pm Last Edit: Apr 02, 2013, 05:29 pm by fat16lib Reason: 1
You can't use SPI_PPM, these pins are not connected to the 2560.

You can't test the signal levels with a multimeter!  You need a scope to see what the peak voltage is when the SPI bus is active.

If Vcc is 5V, the SPI controller will try to drive SCK and MOSI to 5V.  When the chip select pin is in output mode it will also be driven toward 5V.

The SD card is a 3.3V device and should not be driven with 5V signals.  The actual voltage on SD pins will depend on how much current the SD sinks.

The typical "Absolute Maximum Rating" for SD input voltage is Vdd + 0.3V.  If the SD card has a Vdd of 3.3V, this is 3.6V.

Note: Some cards will tolerate 5V input but not all cards will.

bryant507

Thank you,all of you!
Now I should've given up. I will get the data by a Bluetooth module.
Thank you!

Mishka87

Hello
I got the same module, and the same problems.
Can you please post the right circuit of connecting an SD card to arduino board?

Thanks

bryant507


Hello
I got the same module, and the same problems.
Can you please post the right circuit of connecting an SD card to arduino board?

Thanks

        SDcard  -- APM2.5
            5V    -- 5V
            GND -- GND
            MISO -- PIN 50/(MISO/PCINT3)PB3
            MOSI -- PIN 51/(MOSI/PCINT2)PB2
            SCK   -- PIN 52/(SCK/PCINT1)PB1
            CS     -- PIN12/(OC1B/PCINT6)PB6

I doubt that my connection is also wrong.

Nick_Pyner

Getting back to reply #2...........


I reformated the scard by computer.Fat32.
I used a SanDisk 2GB card.
and use the standard SD library


I had a problem with my 2Gb card initialising but all the hardware had worked before so there was no reason to suspect it. Putting the card in the PC, I saw it was formatted FAT32.

I reformatted to FAT.

It now works fine.

Go Up