Pages: 1 [2]   Go Down
Author Topic: SD Card Initialization Help  (Read 4888 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 148
Posts: 6097
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 148
Posts: 6097
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!

Logged

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is correct.

OP means Original Poster = you.
Logged

0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1652
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can I use this SPI_PPM?
Logged

0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1652
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: April 02, 2013, 10:29:38 am by fat16lib » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Israel
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 48
Posts: 2295
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: 1 [2]   Go Up
Jump to: