Micro SD on Mega - won't work, odd voltages

I've never had trouble with these - but others have.
I remembered this --

I don't know if the OP's hash got sorted, but another turned his around ("bad board"). There was another like it (can't find it), and I was going back and forth and back and forth with the chap, kept insisting everything was everything till - bad jumper found.

Sorry for your trouble - it bugs me.

I still don't get the SD card to initialize. Here's a summary of what I've checked so far:

  • I've tried 3 different cards, each formatted properly and working in my laptop.
  • 2 different card readers. Both are 3.3V systems, so no active components on the boards.
  • Checked the wiring card reader -> logic shifter -> Arduino to ensure correct wiring. Posted photos and diagrams (see above). Swapped MISO and MOSI just in case.
  • Checked continuity with a meter from pin to pin to ensure solder joints and jumper wires are good. All checks out.
  • Checked for shorts between pins. No problems
  • Checked voltages. Other than 3.3V power reads 3.29 and 5V reads 4.9, everything is as expected. VCC, MISO, MOSI and CS read 3.29, CLK and GND read 0.
  • Ran the Cardinfo from the Arduino IDE, and a couple of variations from other sources.
  • The only component I haven't swapped out is the Arduino itself. I don't have another one to test, and hoping I don't need to get one just to rule that out.

Every time the result is the same: Initializing SD card...initialization failed!

Is there a way through software to check that the pins are functioning as expected, ie. that voltages are correct and being recognized by the Arduino?

Any other ideas?

Both the Mega and the Uno have the SPI pins on the 6-pin ICSP header. Shields should have that header implemented and those that do implement it have no problems; but not every shield designer / manufacturer did implement that 6-pin header.

You can also ask why the Mega does not have the I2C pins on A4 and A5 :wink:

That's the core of my 'complaint'.

Arduinos are nothing more than breakout boards for processors with the minimum circuitry required to program them conveniently.

The headers were originally breakouts for the processor pins on a per port basis. See e.g. schematics for Uno Rev2 / Diecimila / DueMilaNove.

I do not know the timeline when other boards like Mega and Leonardo were introduced. Problem was that the processor pins that provide A4/A5 on those boards don't carry the I2C signals so a plan had to be made.
Either sacrifice A4/A5 and provide the I2C functionality or keep the analogue functionality and move the I2C functionality to a dedicated set of pins. The latter was chosen and the I2C bus was added on the header next to AREF. I'm 99.99% sure that this was the reason why the Uno was upgraded from Rev2 to Rev3.

I don't think that I have to tell you to consult the datasheets for the involved processors and check the alternate functions of pins.


Enough derailing of the topic :wink:

This ( ↑ ↑ ) I don't need.
Best of luck, railwayguy.

I know most of those words, but not in that order. What exactly am I looking for?

I posted my wiring diagram, pin connections and reference to the mega pinout earlier. Is there something wrong with my wiring?

@railwayguy

The reply was not addressed to you but to @runaway_pancake who I seem to have offended with that.

I rooted about for the Mega I had in The Inventory (received as a gift, not used till now), and soldered up an SD card and a level-shifter card.
And it worked, with the sketch posted in No.18, but not the first time - only because I forgot to put the uSD in it.

I finally got my system to work. I bought another SD card and everything went flawlessly.
I did this sort of as a last resort, but my logic is:

  • Everything else checks out, not only by me but posting sketches, wiring diagrams and pictures for others to critique
  • The first card I used may have been damaged by my early attempts with 5V. See post 7 on that subject
  • The next two cards are 64Gb capacity. My (limited) understanding is that the FAT32 file system can't handle larger capacity cards and so it's formatted as exFAT. This may not be compatible with SD.h. Posts are ambiguous on that topic, with most explicitly mentioning FAT16 and FAT32, with no mention of whether or not exFAT is expected to work. Given the uncertainty, I searched for a 32Gb card - not easy to find these days as they are all larger capacity!
  • Finally, several posts I've read had the same solution "tried multiple cards, found one that works".
  • Note that all the cards work fine in my laptop. The first is formatted FAT16. Several posts mentioned that the Windows format function is unreliable, so I did format using the one from the SD association. The last card I purchased worked out of the box, no formatting required.

For those coming to this post looking for help with their own SD not initializing, see post 22 for the things I've tried. I've read several dozen posts on the subject, and most seem to resolve to wiring issues. If the card initializes but gives other errors when running Cardinfo, then the problem is not with wiring. I remain puzzled as to why properly formatted cards will work in a laptop, but not in an Arduino. I'll leave that for others to explain.

Thank you to all who helped, and especially runaway_pancake for the extra effort he's put in.