Hello,
I bought an Adafruit cataloging shield for my Arduino UNO and I cannot get it to initialise the SD Card. I started out buying a 32GB SD card because the tutorial said it would work up to 32GB. Since reading this forum I noticed someone had a similar problem and it worked for smaller cards. So I have bought 2 further SD cards, both 16GB. I have formatted them using the FAT32 format software that was recommended in the tutorial.
I have attached pictures of the cataloguer and cards and the screen message and sketch. I can't get this to work, please could someone help me?
Datalogging Shield not initialising SD Card
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Puerlin
- Posts: 7
- Joined: Sat Aug 21, 2021 12:56 pm
Datalogging Shield not initialising SD Card
- Attachments
-
- F195523B-98DC-4A73-BB7D-FDC66B259BE8.JPEG (167.88 KiB) Viewed 374 times
-
- A1C1CFE1-7995-40C3-99F2-1229EA4E35C8.JPEG (242.74 KiB) Viewed 374 times
-
- C7E11C00-00DD-4B89-944D-1D90C252A079.JPEG (168.15 KiB) Viewed 374 times
- dastels
- Posts: 15659
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Datalogging Shield not initialising SD Card
Can you copy/paste all of the code and output. Screen shots are nearly useless in this context.
Wait a minute... you didn't install the 2x3 SPI/ICSP header. You need that unless you reconfigured the shield to use D11-D13 for SPI.
Dave
Wait a minute... you didn't install the 2x3 SPI/ICSP header. You need that unless you reconfigured the shield to use D11-D13 for SPI.
Dave
- Puerlin
- Posts: 7
- Joined: Sat Aug 21, 2021 12:56 pm
Re: Datalogging Shield not initialising SD Card
Hi there, thank you for your reply. I have cut and paste the top of the code below.
How do I get the headers you speak of? Could you write the code I need to add to get those please?
/*
SD card test
This example shows how use the utility libraries on which the'
SD library is based in order to get info about your SD card.
Very useful for testing a card when you're not sure whether its working or not.
The circuit:
SD card attached to SPI bus as follows:
** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila
** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila
** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila
** CS - depends on your SD card shield or module.
Pin 4 used here for consistency with other Arduino examples
created 28 Mar 2011
by Limor Fried
modified 9 Apr 2012
by Tom Igoe
*/
// include the SD library:
#include <SPI.h>
#include <SD.h>
// set up variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;
// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
// MKRZero SD: SDCARD_SS_PIN
const int chipSelect = 10;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.print("\nInitializing SD card...");
// we'll use the initialization code from the utility libraries
// since we're just testing if the card is working!
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
Serial.println("initialization failed. Things to check:");
Serial.println("* is a card inserted?");
Serial.println("* is your wiring correct?");
Serial.println("* did you change the chipSelect pin to match your shield or module?");
while (1);
} else {
Serial.println("Wiring is correct and a card is present.");
}
// print the type of card
Serial.println();
Serial.print("Card type: ");
How do I get the headers you speak of? Could you write the code I need to add to get those please?
/*
SD card test
This example shows how use the utility libraries on which the'
SD library is based in order to get info about your SD card.
Very useful for testing a card when you're not sure whether its working or not.
The circuit:
SD card attached to SPI bus as follows:
** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila
** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila
** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila
** CS - depends on your SD card shield or module.
Pin 4 used here for consistency with other Arduino examples
created 28 Mar 2011
by Limor Fried
modified 9 Apr 2012
by Tom Igoe
*/
// include the SD library:
#include <SPI.h>
#include <SD.h>
// set up variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;
// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
// MKRZero SD: SDCARD_SS_PIN
const int chipSelect = 10;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.print("\nInitializing SD card...");
// we'll use the initialization code from the utility libraries
// since we're just testing if the card is working!
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
Serial.println("initialization failed. Things to check:");
Serial.println("* is a card inserted?");
Serial.println("* is your wiring correct?");
Serial.println("* did you change the chipSelect pin to match your shield or module?");
while (1);
} else {
Serial.println("Wiring is correct and a card is present.");
}
// print the type of card
Serial.println();
Serial.print("Card type: ");
- Puerlin
- Posts: 7
- Joined: Sat Aug 21, 2021 12:56 pm
Re: Datalogging Shield not initialising SD Card
Sorry I just read your post again, do you mean i need to solder the other 2x3 connector that joins to the UNO? Is it the one at the back or the one nearest the USB port?
- dastels
- Posts: 15659
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Datalogging Shield not initialising SD Card
Right. it goes as the end of the board... farthest from the end with the USB and power connectors. The UNO should have one to match it. See https://learn.adafruit.com/adafruit-dat ... ep-2172271.
Dave
Dave
Please be positive and constructive with your questions and comments.