Pages: [1]   Go Down
Author Topic: SD Card not found using stock pinout/SD card program  (Read 1169 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

We've recently been struggling with a hardware issue concerning activating the SD card reliably on the Uno.

We have it set to all of the stock pins, with the exception of chip select, which is on Pin 10 instead of Pin 4. We've had it working several times and successfully written data, however, now, no matter the configuration we put the card in, and even using the stock SD card test moving back to pin 4, we cannot get the card to function reliably with the Uno. However, it functions normally with an SD card slot on a PC.

I've attached the two most common pin setups we used, a basic generic direct mapping from pin to pin with a 3.3v Supply off the board to V_DD, or our voltage divided supply so that all pins are operating on 3.3V.

Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8657
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You shouldn't have a voltage divider on the MISO line.  That's an output from the SD card and is already 3.3V.

Starting at the clipped corner the pins should be:
9 No Connection
1 CS <- SS with voltage divider
2 Data In <- MOSI with voltage divider
3 Ground <-> Ground
4 Vss <- +3.3v
5 CLK <- SCK with voltage divider
6 Vss2 <-> Ground
7 Data Out -> MISO (NO voltage divider)
8 No Connection
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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

Alright, I'm sure we haven't had it like that, I just hastily did the diagram from memory. We also just tried your suggestion and it's still not firing up. We've tried multiple spots on the breadboard as well as 1 to 1 solder on an old SD card. It's been frustrating to say the least.

Are SD card failures most commonly related to hardware/compatibility issues or software?

We're also running an LCD screen if that helps as well.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8657
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does the LCD use the SPI interface or any of the SPI pins?  If so, that could be a problem.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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

As of right now, we have the screen disabled while running the SD card because we're attempting to troubleshoot it, however, we will eventually have to run them off the SPI at the same time. However, when we had it first working and datalogging, I had both the LCD and the SD card active.
Logged

0
Online Online
Edison Member
*
Karma: 63
Posts: 1599
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Problems using resistor level shifters are common with SD cards.  The rise time spec for SPI signals for SD cards is a max of 10 ns.

This is hard to maintain with resistor level shifters.

Cards vary a lot.  Some newer cards have edge detectors and won't work at all.  Best to use older cards.

Also expect undetected errors since CRC is disabled due to lack of hardware on the Arduino.

The Arduino SD.h library is a wrapper for my SdFat library and I see lots of problems like this.

If possible use an IC level shifter.
« Last Edit: July 26, 2011, 03:08:01 pm by fat16lib » Logged

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

Dont think we'll be able to get ahold of IC level shifters. I guess the best bet is to go with an older card?
Logged

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

Dont think we'll be able to get ahold of IC level shifters. I guess the best bet is to go with an older card?

The best bet would be to run your AVR at 3.3v using a 3.3v voltage regulator. Running the avr at 16mhz at 3.3v is only slightly overclocking it by about 2 mhz, but these chips are rock solid and i have never come across any instability. If you run the AVR at 3.3v, then you avoid all this hassle of level shifting etc and can directly interface to the SD card
Logged

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

We're running the whole project off the Uno Board, so I dont know if that's an option or not. Went to all the electronics stores and we found out we can't get any level shifters there. Voltage regulators probably wont fit on the board either, so we're either having to buy an ethernet shield or we're SOL for having the SD card working
Logged

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

We're running the whole project off the Uno Board, so I dont know if that's an option or not. Went to all the electronics stores and we found out we can't get any level shifters there. Voltage regulators probably wont fit on the board either, so we're either having to buy an ethernet shield or we're SOL for having the SD card working

You can try resistor based shifting, just use the values i have used and keep the wires short. The spi bus switches at MHZ speeds so kep the wires short as otherwise they can lead to isntability. Also please try to keep a supply decoupling capacitor close to the SD cards power input.

Here is a example of what i did........

http://kalum.posterous.com/sd-cards-and-arduino

This should work if you use the same resistor values and keep the wires short.
Here is my mp3 player which used resistor level shifters

http://kalum.posterous.com/50759184

Logged

Pages: [1]   Go Up
Jump to: