Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Micro SD shield problem with chip kit Max32

Status
Not open for further replies.

mmp131316

Junior Member level 1
Joined
Mar 6, 2011
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,427
Hello everybody i am trying to use chip kit max32 with the sd card shield (this is the shield https://www.sparkfun.com/tutorials/172)
I am making the following connections
chip kit sd shield
pin 50 - pin 12
pin 51 - pin 11
pin 52 - pin 13
pin 53 - pin 4
and pin 10 from the chip kit is connected to the pin 10 from the shield
and of course the vcc from 3.3 v from chip kit to the shields 3.3 v and the ground also
With this configuration and the following code I am receiving the initialization failed message
Code:
/*
 #include <SD.h>

File myFile;

void setup()
{
  Serial.begin(9600);
  Serial.print("Initializing SD card...");
 
  pinMode(10, OUTPUT);
   
  if (!SD.begin(53)) {
    Serial.println("initialization failed!");
    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("lala th city guy.");
	// close the file:
    myFile.close();
    Serial.println("done.");
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");
  }
  
  // re-open the file for reading:
  myFile = SD.open("test.txt");
  if (myFile) {
    Serial.println("test.txt:");
    
    // read from the file until there's nothing else in it:
    while (myFile.available()) {
    	Serial.write(myFile.read());
    }
    // close the file:
    myFile.close();
  } else {
  	// if the file didn't open, print an error:
    Serial.println("error opening test.txt");
  }
}

void loop()
{
	// nothing happens after setup
}
Please give any suggestions regarding why does this work properly !

Thanks for your time. Cheers ;-)
 

I actually came across a different pinout for the MEGA Arduinos for SPI shields:

You can get this shield to work with the Arduino Mega. For those who have tried and failed, here is how. You do not need to change anything software-wise.
The SPI pins for Arduino Mega are located elsewhere (pin 50-53 instead of 10-13). Simply bend out pins 10, 11, 12 and 13 on the shield so that they do not go into the Mega. Stick the shield in. Put a jumper wire in the headers of pin 10-13 and route them as follows:
Shield pin 10 —> Mega pin 53
Shield pin 11 —> Mega pin 51
Shield pin 12 —> Mega pin 50
Shield pin 13 —> Mega pin 52
This applies to all SPI shields.

Arduino Ethernet Shield MEGA hack

However, these guidelines may not work with the chipKIT MAX32.

BigDog
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top