I am trying to test CardInfo with an arduino mega and a 1GB mircoSD card. I am using a mac and can only format the SD card with FAT, which gives FAT16. When I run the program I get:
Initializing SD card...Wiring is correct and a card is present.
Card type: SD2
Could not find FAT16/FAT32 partition.
Make sure you've formatted the card
I formated it once on a PC with FAT32 and it worked once, however I would like to stick with my mac.
If anyone could tell me what I am doing wrong that would be greatly appreciated,
Thanks.
I am using a 2 Gb Sandisk MicroSD card both on my Mac and on a MicroSD reader. I'm not sure where I formatted it. I think I read that the best way to format for the Arduino use was to format on the board (run a formatting sketch).
Sadly the Mac is a poor choice for formatting SD cards. Macs do not conform to the SD standard format.
It is likely you have formatted the card with a GUID Partition Table (GPT). The SD standard specifies SD cards must be formatted with a MBR partition table. Most cameras and phones accept this non-standard GPT format but Arduino has so little memory so GPT is not accepted.
Once a card is formatted GPT Windows often preserves this format.
Card less than 4 GB should be formatted FAT16 for best performance and cards 4 GB and larger must be formatted FAT32. Also the SD standard requires this formatting.
In addition to the GPT/MBR problem, Mac, Linux, and Windows utilities do not align file structures on the correct boundaries to optimize access to the SD card's flash chips.
Most operating systems are learning about solid state drives (SSD) but OS utilities don't understand SD cards yet.
SD card manufactures produce cards that perform best when formatted according to the SD formatting standard.
I did connect the VCC to 3.3V. I didn't do anything to 5V SPI SCK and MOSI signals, what would you recommend? The write/read test programs has worked once with the CS, DI, SCK and DO connected directly to the mega.
Don't try any other micros SD cards. They may be damaged by the high voltage signals.
As Sparkfun says about their shield:
All new microSD shields have a voltage converter chip on-board that converts the Arduino 5V signals to 3.3V signals in accordance with SD specifications. No more 'blown up' SD cards!
The best approach is to use a level shifter like these adapters/shields
It might work but this is a poor solution. Resistor based level shifters fail with many newer SD cards since new cards have edge detectors for the signals and resistors round signal edges.
This is the reason that almost all commercial products now use semiconductor buffers/level shifters.
Good luck if you try it. You might want to download the new SdFat beta and enable CRC to detect any data errors and slow down the SPI clock.