Offline
Newbie
Karma: 0
Posts: 35
|
 |
« on: July 14, 2012, 08:25:28 am » |
Hiya,
I am using Arduino Uno with Arduino Xbee + SD Shield, The card i am using is SanDisk 2GB micro SD Card, The card appears to work fine when recently formatted in PC, but if you remove it once or twice from the shield put it in computer and then put back in arduino it gets unreadable by Arduino. Dosnt matter which code i run, the default SD Library sketch SDcardinfo also dont seem to initialize the card.... What could be the problem?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 1
Posts: 224
|
 |
« Reply #1 on: July 14, 2012, 06:22:32 pm » |
exactly which SD shield/module do you use?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« Reply #2 on: July 14, 2012, 06:34:17 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 1
Posts: 224
|
 |
« Reply #3 on: July 14, 2012, 06:56:15 pm » |
maybe try another sd card.
i had some error stuff when i pulled out the sd card while ardu was writing on it, maybe thats a problem too
i pulled in and out my oldschool 128 mb sd card like 20 times in the last 20min... and no problems, but i checked always on serial monitor when ardu finished writing to sd
|
|
|
|
« Last Edit: July 14, 2012, 06:58:36 pm by lax123 »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« Reply #4 on: July 15, 2012, 08:23:35 am » |
Ive tried another card, 8GB Nokia Micro SD Card... Same problem persist!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 1
Posts: 224
|
 |
« Reply #5 on: July 15, 2012, 08:31:19 am » |
does the sd formatter programm work properly? if you remove it once or twice from the shield put it in computer and then put back in arduino it gets unreadable by Arduino.
r u really just putting it in and out, without doing something else?
|
|
|
|
« Last Edit: July 15, 2012, 08:34:07 am by lax123 »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« Reply #6 on: July 15, 2012, 08:33:37 am » |
Yes ive tried both ways, creating a txt file in the card from computer and doing nothing (i.e just insert in the computer and take it out)
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 1
Posts: 224
|
 |
« Reply #7 on: July 15, 2012, 08:34:16 am » |
i had a similar problem, but the reason was that i just have a really really cheap sd module which suxx, so i had to put some resistors into its circuit to make it work properly, but i doubt thats the case with your original shield.
does the sd formatter work, by fatlib?
once its unreadable for arduino, the computer still has no problems in reading the data?
|
|
|
|
« Last Edit: July 15, 2012, 08:36:57 am by lax123 »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« Reply #8 on: July 15, 2012, 08:40:59 am » |
Which library are you using? and which filesystem u use to FORMAT the card?
i am not sure whether these things could effect the initialization of the card !!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 1
Posts: 224
|
 |
« Reply #9 on: July 15, 2012, 08:45:58 am » |
i use sdfatlib20111205 http://code.google.com/p/sdfatlib/downloads/listi formatted with the sd formatter sdfatlib20111205\SdFat\examples\SdFormatter in my current project i just use SD.h instead of SdFat, but both worked
|
|
|
|
« Last Edit: July 15, 2012, 08:50:41 am by lax123 »
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 28
Posts: 1079
Arduino rocks
|
 |
« Reply #10 on: July 15, 2012, 10:08:13 am » |
SD.h is SdFat. SD.h is just an API translation layer for an old version of SdFat. The Adruino group wanted a "simpler API".
Does it fail you run the SdFat QuickStart or SdInfo examples? If it fails what are the error codes?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« Reply #11 on: July 15, 2012, 08:35:11 pm » |
SD.h is SdFat. SD.h is just an API translation layer for an old version of SdFat. The Adruino group wanted a "simpler API".
Does it fail you run the SdFat QuickStart or SdInfo examples? If it fails what are the error codes?
How to see the error codes? I simply see "Card Initialization Failed" in the Serial Communication Window
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 28
Posts: 1079
Arduino rocks
|
 |
« Reply #12 on: July 15, 2012, 09:10:54 pm » |
You need to run the QuickStart or SdInfo examples in the SdFat/examples folder. The Arduino group didn't include these examples so you need to download SdFat here http://code.google.com/p/sdfatlib/downloads/listQuickStart's output looks like this with the errorCode at the end: SD initialization failed. Do not reformat the card! Is the card correctly inserted? Is chipSelect set to the correct value? Is there a wiring/soldering problem? errorCode: 0x2, errorData: 0xff
SdInfo's output looks like this: card.init failed SD errorCode: 0X2 SD errorData: 0X20
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« Reply #13 on: July 16, 2012, 07:40:49 am » |
errorCode: 0x1, errorData: 0x0
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 35
|
 |
« Reply #14 on: July 16, 2012, 07:58:53 am » |
& When i use the SDFormatter example it gives
error: cardSize SD error: 10,ff
& When i format from computer and again format using the SDFormatter it gives
Card Size: 1886 MB, (MB = 1,048,576 bytes)
Erasing ............... All data set to 0x00 Erase done
Formatting Blocks/Cluster: 64 FAT16 error: write MBR SD error: 6,4
|
|
|
|
« Last Edit: July 16, 2012, 08:05:05 am by simplytuff »
|
Logged
|
|
|
|
|
|