1 2 3 Previous Next 43 Replies Latest reply on Dec 12, 2012 3:42 AM by neilk Go to original post
      • 30. Re: SD Card interface board made by LC Studio/lcsoft.net
        neilk

        That's fantastic, Pablo. Congratulations. As a matter of interest, does the Chipkit max32 deliver 3.3v signals directly to the LC Studio board, or did you have to build a level shifter?

        • 31. Re: SD Card interface board made by LC Studio/lcsoft.net
          Sanzer

          It does directly, but I'm using 5v pin instead of 3.3v and it works great.

          • 32. Re: SD Card interface board made by LC Studio/lcsoft.net
            knoakes

            For all those trying to use the lcsoft SD board. I had many problems using an Arduino Mega 2560 and have not yet made this work. So as a last attempt I tried using an Arduino Duo using the pin connections in the original post and it worked frst time.

             

            The code I used was someone else's example and works fine and I can read the text file it creates on a pc (copied below)

            I have only connected the +5v rail and I do not have any resistors in series or circuitry to drop the voltage. I may be wrong, but I believe the board has some current limited resistors already on the board.

             

            #include <SD.h>

             

            File myFile;

             

            void setup()

            {

              Serial.begin(9600);

              Serial.print("Initializing SD card...");

              // On the Ethernet Shield, CS is pin 4. It's set as an output by default.

              // Note that even if it's not used as the CS pin, the hardware SS pin

              // (10 on most Arduino boards, 53 on the Mega) must be left as an output

              // or the SD library functions will not work.

             

             

              if (!SD.begin(10)) {

                Serial.println(SD.begin(10));

                //return;

              }

              Serial.println("initialization done.");

             

              // open the file. note that only one file can be open at a time,

              // so you have to close this one before opening another.

              myFile = SD.open("test.txt", FILE_WRITE);

             

              // if the file opened okay, write to it:

              if (myFile) {

                Serial.print("Writing to test.txt...");

                myFile.println("testing 1, 2, 3.");

                      // close the file:

                myFile.close();

                Serial.println("done.");

              } else {

                // if the file didn't open, print an error:

                Serial.println("error opening test.txt");

              }

            }

             

            void loop()

            {

                      // nothing happens after setup

            }

            • 33. Re: SD Card interface board made by LC Studio/lcsoft.net
              neilk

              Congratulations, Kevin! Further evidence to support the view that ALL of my problems originated from the actual SD Card. Well, you live and learn!

              • 34. Re: SD Card interface board made by LC Studio/lcsoft.net
                knoakes

                Just in case it helps anyone else, I now have it working with my Arduino Mega 2560.

                 

                Pins are as expected and well documented elsewhere

                MISO : Pin 50

                SCK : Pin 52

                MOSI: Pin 51

                CS : Pin 53

                 

                Here's a sketch I used to list the contents of the SD card (not my code )

                 

                /*

                  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 16 Mar 2011

                by Tom Igoe

                */

                // include the SD library:

                #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

                const int chipSelect = 53;   

                 

                void setup()

                {

                  Serial.begin(9600);

                  Serial.print("\nInitializing SD card...");

                  // On the Ethernet Shield, CS is pin 4. It's set as an output by default.

                  // Note that even if it's not used as the CS pin, the hardware SS pin

                  // (10 on most Arduino boards, 53 on the Mega) must be left as an output

                  // or the SD library functions will not work.

                  pinMode(53, OUTPUT);     // change this to 53 on a mega

                 

                  // we'll use the initialization code from the utility libraries

                  // since we're just testing if the card is working!

                  if (!card.init(SPI_QUARTER_SPEED, chipSelect)) {

                    Serial.println("initialization failed. Things to check:");

                    Serial.println("* is a card is inserted?");

                    Serial.println("* Is your wiring correct?");

                    Serial.println("* did you change the chipSelect pin to match your shield or module?");

                    return;

                  } else {

                   Serial.println("Wiring is correct and a card is present.");

                  }

                 

                  // print the type of card

                  Serial.print("\nCard type: ");

                  switch(card.type()) {

                    case SD_CARD_TYPE_SD1:

                      Serial.println("SD1");

                      break;

                    case SD_CARD_TYPE_SD2:

                      Serial.println("SD2");

                      break;

                    case SD_CARD_TYPE_SDHC:

                      Serial.println("SDHC");

                      break;

                    default:

                      Serial.println("Unknown");

                  }

                 

                  // Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32

                  if (!volume.init(card)) {

                    Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card");

                    return;

                  }

                 

                 

                 

                 

                  // print the type and size of the first FAT-type volume

                  long volumesize;

                  Serial.print("\nVolume type is FAT");

                  Serial.println(volume.fatType(), DEC);

                  Serial.println();

                 

                  volumesize = volume.blocksPerCluster();    // clusters are collections of blocks

                  volumesize *= volume.clusterCount();       // we'll have a lot of clusters

                  volumesize *= 512;                            // SD card blocks are always 512 bytes

                  Serial.print("Volume size (bytes): ");

                  Serial.println(volumesize);

                  Serial.print("Volume size (Kbytes): ");

                  volumesize /= 1024;

                  Serial.println(volumesize);

                  Serial.print("Volume size (Mbytes): ");

                  volumesize /= 1024;

                  Serial.println(volumesize);

                 

                  Serial.println("\nFiles found on the card (name, date and size in bytes): ");

                  root.openRoot(volume);

                 

                  // list all files in the card with date and size

                  root.ls(LS_R | LS_DATE | LS_SIZE);

                }

                 

                 

                void loop(void) {

                 

                }

                • 35. Re: SD Card interface board made by LC Studio/lcsoft.net
                  bmac2

                  using your pin structure you put above, I was able to successfully read 2 different SD cards on my LC Studios card using a Mega.  it read my 16 gig HDSC card Sandisk, and also read a PNY 2 gig that had a bunch of videos/pics on it from a camera.  I am glad YOU found the pins to use, I have been hunting since I got my mega in yesterday to figure this out.  Now on to temp and ph probes!!!

                   

                  Mac

                  • 36. Re: SD Card interface board made by LC Studio/lcsoft.net
                    bmac2

                    output from serial monitor showing it reading the card.

                     

                     

                    Initializing SD card...Wiring is correct and a card is present.

                     

                    Card type: SD2

                     

                    Volume type is FAT16

                     

                    Volume size (bytes): 1966800896

                    Volume size (Kbytes): 1920704

                    Volume size (Mbytes): 1875

                     

                    Files found on the card (name, date and size in bytes): 

                    DCIM/         2008-01-01 12:00:04

                      100MEDIA/     2008-01-01 12:00:04

                        SUNP0037.JPG  2008-11-29 20:12:46 82465

                        SUNP0038.JPG  2008-11-29 20:12:54 84479

                        SUNP0005.AVI  2008-01-05 13:24:56 3184344

                        SUNP0006.JPG  2008-01-05 13:25:12 134270

                        SUNP0008.AVI  2008-01-05 13:25:54 1215080

                        SUNP0009.JPG  2008-01-05 13:26:00 126620

                        SUNP0011.JPG  2008-01-05 14:43:40 143593

                        SUNP0012.JPG  2008-01-05 14:44:10 132048

                        SUNP0013.AVI  2008-01-05 14:45:02 7057480

                        SUNP0014.AVI  2008-01-05 14:46:32 29801992

                        SUNP0015.AVI  2008-01-05 14:48:44 55305000

                        SUNP0016.AVI  2008-01-05 14:49:50 24944696

                        SUNP0017.AVI  2008-01-05 14:51:16 34266552

                        SUNP0018.AVI  2008-01-05 14:52:56 41782040

                        SUNP0019.AVI  2008-01-05 14:54:40 36283880

                        SUNP0020.JPG  2008-01-05 14:54:58 132111132111

                        SUNP0021.AVI  2008-01-05 14:56:22 27502472

                        SUNP0022.AVI  2008-01-05 14:58:06 44539848

                        SUNP0023.AVI  2008-01-05 14:59:36 31050248

                        SUNP0024.AVI  2008-01-05 15:00:28 15262664

                        SUNP0025.AVI  2008-01-05 15:00:52 3446376

                        SUNP0026.AVI  2008-01-05 15:02:56 30331544

                        SUNP0027.AVI  2008-01-05 15:05:14 21797256

                        SUNP0028.JPG  2008-01-05 15:05:42 130155

                        SUNP0029.JPG  2008-01-05 15:05:50 128528

                        SUNP0030.AVI  2008-01-05 15:08:30 57274600

                        SUNP0031.AVI  2008-01-05 15:10:58 39682216

                        SUNP0032.AVI  2008-01-05 15:11:32 3577288

                        SUNP0033.AVI  2008-01-05 15:12:18 9025512

                        SUNP0034.AVI  2008-01-05 15:13:40 28947464

                        SUNP0035.AVI  2008-01-05 15:15:36 12636584

                        SUNP0036.AVI  2008-01-05 15:17:38 52090104

                    • 37. Re: SD Card interface board made by LC Studio/lcsoft.net
                      knuckle73

                      Christopher,

                        No need to revers engineer ladyada's board as the schematic for the board is available from github. https://github.com/adafruit/MicroSD-breakout-board

                      • 38. Re: SD Card interface board made by LC Studio/lcsoft.net
                        r3cgm

                        Thanks for the heads up Bruce Dailey Jr!  I'm really glad that Lady Ada published these schematics... makes life a lot easier.

                        • 39. Re: SD Card interface board made by LC Studio/lcsoft.net
                          knuckle73

                          My pleasure, best of luck.

                          • 40. Re: SD Card interface board made by LC Studio/lcsoft.net
                            biacapelli

                            Hi, I know this topic is a little old, but I really need some help. I'm using the LCStudio SDCard module, and I turned it on without reading any instruction, and it didn't work, so I thought I had broken it, but I insisted on this topic and found your message (Kevin Noakes) - I connected my module to 5V straight, without any resistors, like you did, but the code still does not work for me . Using yours or the standard code (ReadWrite - arduino.cc), I keep getting the same results, the SD.begin(cspin) function returns 0... "Initialization failed".

                             

                            Is there anything you can tell me so I can make it work?

                             

                            My connections: GND on Arduino GND, 5V on Arduino 5V, MOSI on Arduino 11, MISO on Arduino 12, CLK on Arduino 13, CS on Arduino 4.

                             

                            Is there a chance I ruined my module? Is there a way I can verify this? Or I just buy another one without knowing the problem? I would be REALLY pleased if you'd answer me!

                             

                            Thank You,

                            biacapelli

                            • 41. Re: SD Card interface board made by LC Studio/lcsoft.net
                              neilk

                              I can't be sure you haven't damaged the board; however, make sure you try a number of SD Cards, which I believe should be less than 2GB capacity.

                              Good Luck

                              Neil kenyon

                              • 42. Re: SD Card interface board made by LC Studio/lcsoft.net
                                biacapelli

                                I'm using a 2GB microSD in a microSD2SD adapter... I'll try to reduce the capacity, but this may be my last hope haha thanks, by the way!

                                • 43. Re: SD Card interface board made by LC Studio/lcsoft.net
                                  neilk

                                  OK - I couldn't get a microSD card to work at all in my setup. I have read somewhere that newer cards sometimes require sharper pulses than the arduino can deliver. Older cards are said to be better; the ones I got working were all about 3 years old!

                                   

                                  Also,are you testing with the super simple sketch "Cardinfo" which comes with the SD card library?

                                   

                                  Keep trying........even though I destroyed my LC soft card & am now using a different make, other people have managed to get it working!

                                  1 2 3 Previous Next