I see a lot of discussion of this, but I've tried most of the suggestions and am still having no luck getting my SD card off the ground. Any help much appreciated!
it has power (has an power LED, which is a nice touch).
It has a 2GB card in it, freshly formatted by the app from sdcard.org. Mac OS X disk utility says:
Mount Point : /Volumes/CANON_DC Capacity : 2.05 GB (2,045,121,024 Bytes)
Format : MS-DOS (FAT16) Available : 2.04 GB (2,042,167,296 Bytes)
Owners Enabled : No Used : 2.7 MB (2,686,976 Bytes)
Number of Folders : 0 Number of Files : 512
I've tried swapping 50 and 51 too; and using pinmode() to set 53 and/or 4 to output. There's no Ethernet device in sight. I do have a low-side switch hanging off pin 10, so I'd have to move that before I could freely set 10 high; but from what I've read, SD on a Mega shouldn't care about pins 10-13 at all.
@sderose, you're new to Arduino, and wouldn't imagine it, but the Arduino environment has tons and tons of bugs all over the place. That's why there are over 2,000,00 posts on this forum.
Bill didn't specifically mention it, but the SD library that comes with the Arduino IDE is 5 years out of date. You'd think the sketches might work properly even so, I mean for crying out loud, people have been using them for 5 years! However, the "Cardinfo" sketch only works part-way on my Arduino [ie, it hangs when trying to run the "root.ls(LS_R | LS_DATE | LS_SIZE);" line], and the "Files" sketch, which creates and removes a file, ate my SD card a couple of days ago. OTOH, the "listfiles" example sketch works fine for me.
After running "Files", the card was unusable on both Arduino and Win8.1, but I used SDFormatter4 to reformat it, and it's ok.
I'm no expert with SD, and just seem to have a lot of trouble with it, so:
I would recommend using Bill's updated SdFat library, and maybe things will work better.
this is important: whatever you do,
2a. DO NOT USE ANY SD CARD WITH THE ARDUINO THAT HAS "IMPORTANT" DATA ON IT - EVER!
2b. ALLOCATE AN SD CARD TO USE WITH ARDUINO, AND DON'T USE IT FOR ANY OTHER BACKUP STORAGE!
Other people may not agree with this, but you're less likely to lose important backup data this way. If this doesn't sound like good advice, then .... never mind :-).
I updated to to SdFat off of github, installed it, and tried Quickstart. Also got a brand-new SanDisk 8GB card, and formatted with the util from sdcard.org. I tried it before the re-format (it came formatted Fat32), and that didn't seem to work. But now it does.
Much better messages, and self-config! It actually told me which pins it was expecting, so I didn't have to switch 50 an 51 back and forth (reports vary on which is which).
It reports weird filenames (as below), but at least i can see the device! Thanks!
Bill can help you debug the problem. I just wanted to get your attention in regards cards being destroyed, and out-of-date IDE library.
I have several 8+ GB cards with back-up data from my tablet and notebooks, and I would never ever stick one of these cards into an Arduino system. Too much to lose. So, I have a couple of small SD cards for Arduino use, which I will read on the PCs, but not store PC backup data on.
Here is a quote from the html documentation for SdFat-beta:
SdFat supports Long File Names. Long names in SdFat are limited to 7-bit ASCII characters in the range 0X20 - 0X7E The following are reserved characters:
< (less than)
(greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)