Go Down

Topic: SD card error - SOLVED (Read 3765 times) previous topic - next topic

CrossRoads

Jun 05, 2011, 11:33 pm Last Edit: Jun 06, 2011, 06:26 pm by CrossRoads Reason: 1
Anybody see anything wrong with this design?
5V and 3.3V come from regulators with 10uf/100nF on input pins and 100nF on the output pins.
LM2936MP-3.3
MC33269D-5.0
R28 is 10k.
Signals are coming from/going to an AT1284.

Should be just like this one.
http://www.ladyada.net/make/logshield/design.html


Thanks
Robert


The shield works, the embedded design does not. They use seperate SS pins, so no conflict there.

"The SD card socket on board does not work. I
spent some time just now with my volt meter tracing stuff. I also verified
the correct pin use on the SD socket. Everything is as it should be, but I
have no way to verify voltage at the output pin of the SD. And, the error
I get is a read error.

The voltage out of the level shifter on SD card PIN 5 is 3.84 and it is
properly connected (through the level shifter) to the CPU. Same with SS
and MOSI. I also verified 3.84V on the VDD pins and a good ground on the
GND pins.

I noticed that the SD card data out pin (MISO) does not go through the
level shifter, but directly to the CPU.

I also noted that my SD card shield works perfectly on this board, so SPI
itself is working and so is the test software that talks to the SD card."
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

davekw7x

#1
Jun 06, 2011, 03:51 pm Last Edit: Jun 06, 2011, 04:45 pm by davekw7x Reason: 1
just like this one...


Close, but no banana.

Here's the deal:

Your 74ACT125 is specified for operation with values of Vcc from 4.5 to 5.5 Volts.  It may (or may not) appear to work at 3.3 Volts, but reliable operation at SPI speeds is not guaranteed.

The ladyada design's 74AHC125 is specified to operate with values of Vcc from 2.0 to 5.5 Volts with inputs that are tolerant to input values up to 5.5 Volts regardless of Vcc.

For my designs I (usually) use a '4050 device ( the 74HC4050 or even the old CD4050) to shift from 5 Volts down to 3.3.

As for the MISO signal: If there are other properly designed SPI devices and they all are operating at 3.3 Volts, then the Arduino input will see the 3.3 Volt logic 1 from whichever one is enabled.  (Modern CMOS devices "usually" have logic '1' output signals that are very close to the Vcc rail)

Note that for ATmega devices in Arduino circuits, when operating at Vcc = 5 Volts, the ATmega input pin will see a logic '1' if the signal on an input pin is greater than  or equal to 3.0 Volts, so the 3.3 Volt MISO signal works as it should with no extra conditioning required.

On the other hand...

If other SPI devices operate from 5 Volts, their MISO signal will go from 0 to 5 Volts, and will "backdrive" an overvoltage to any SPI devices running with Vcc = 3.3 Volts.  Operation is unpredictable and long-term reliability (maybe even short-term reliability) of the overdriven devices is jeopardized unless they are specifically rated for such things---SD cards are not specifically rated for being backdriven by an overvoltage.

Note that for the Arduino Ethernet shield, the Ethernet controller and the SD card both operate at Vcc = 3.3 Volts, so that they can play nice together.  The Ethernet controller has inputs that are 5-Volt tolerant, so it doesn't need level shifters for its SPI input signals, and the level shifters are required in the SD card circuitry only.


Regards,

Dave

CrossRoads

Dave,
Problem turned out to be the regulator - lost track of the need to have a higher current capable part.
Jumpered over 3.3V from another source, card is responding now.  Different regulator, Pin compatible, or order.

The 74ACT125 seems to be happy working that way.

Robert
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

I am not 100% sure what the '125 driver is at this point - the part I thought we used is not carried by Digikey, and most parts were purchased from Digikey.  Will have to at the actual part and see what it is.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Dave,
Turns out it was 74AC125:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=497-1017-1-ND

Library part used for the schematic was the ACT part, which are not actually purchasable at Digikey.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

wlewis

#5
Jul 19, 2011, 11:47 am Last Edit: Jul 20, 2011, 12:46 am by wlewis Reason: 1
1. if your sd card is not spi compatible.. you simply will not get any results - if (as a last resort) you use your cel phone's sd card (assuming its recent) make sure you get your cel phone's permission.. mine was in the cel phone switch off menu.

2. The 74HCT244N also works.


Boffin1

Hi Rob,

Did you come right with your SD cards?  I have had problems using any card other than the old  256 Mb ones, but all the latest ones like the 2 Gb and micro SD with adaptor fail after a while. ( weeks or a month )

I changed the 125 chip and it made no difference.

I have resorted to buying old smaller cards from camera repair shops !
With my mobile phone I can call people and talk to them -  how smart can you get ?

CrossRoads

Hi John,
Yes, I only tested with a 16 GB Sandisk Ultra 15 MB/s SD card, and a Pony something or other 4GB microSD card in a SD adapter.
Both tested fine with fat16lib's SdFat library and the 74AC125 chip.

I believe the key is having enough current at 3.3V. I used a seperate regulator good for 400mA that only drives the SD circuit.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Boffin1

You might be right there Rob,
If you have got the microSD in the adaptor working reliably, you are miles ahead.

I will try a separate 3.3v supply when I have one hooked up on the bench again ( and scope the supply as it is first )
With my mobile phone I can call people and talk to them -  how smart can you get ?

CrossRoads

Electrically it went very smooth.  Basically using the same interface as the the adafruit shield.

Software was trickier - I had to figure out how pins_arduino.c mapped the physical pins to the names they respond to, how to make my usage of the ATMega1284 get called out in place of the generic callout (which pretty much says if its not a 1280/2560, use the 168/328 settings).

The for SdFat, had to make the same kind of changes for pin mappings, and callout the slave select line properly.

Took a few tries with several back & forths with fat16lib & others to understand it all.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up