Forum >dfr0229 microSD card reader and leonardo
ArduinoGeneral

dfr0229 microSD card reader and leonardo

userHead ecangis 2016-05-05 10:53:11 18073 Views2 Replies
So, hi, i have been working around with the microSD card reader (cod. dfr0229) and the arduino expansion for raspberry (cod. DFR0327) that until i have understood is compatible as arduino leonardo.

the arduino works great, i even have a lcd display working without any problem, but the sd card reader don't seem to work so well, i have connected it to the icsp pins, taking like number one the closest to reset button and border, changed the jumper quite few times and don't seems to be the problem. The most crazy thing is that when i reset the arduino it randomly trow a correct initialization but when i reset or turn it off and on later it stop working, if i have to give a statistic, i would say it works one every 30 times or more. i also discard the shield being broken because eventually it work and the red led is turn on.

what could it be? may something in the connection be wrong?
for your answer, thanks

p.s. just working around with it, somehow, if i take off the sd card of the reader everything go well, but if i put the sd card on the failure keep coming.
2016-05-09 09:30:08 yeah, hi, respected to the spa connection i have all connected to the icsp pins on the board, which should correspond to the arduino board if i'm not wrong, maybe i made a mistake talking of spi.

respecte to the code my hole code is the next:
Code: Select all
 #include <SPI.h>
#include <SD.h>
#include <LiquidCrystal.h>

//constantes
Sd2Card card;
SdVolume volume;

File root;
char* files[1];

int Sdpin = 8;
int Irpin = 9;
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
int x=0;

void setup() {
  //Start serial connection and pin setup

  Serial.begin(9600);
  pinMode(Irpin, INPUT);
 
  //begin lcd screen
 
  lcd.begin(16, 2);
 
  lcd.clear();
  lcd.print("Iniciando");
  lcd.setCursor(0,1);
  lcd.print("sistema");

  //Try connect sd card
 
  if(!card.init(SPI_HALF_SPEED, Sdpin)){
    lcd.clear();
    lcd.print("Sin conexion con");
    lcd.setCursor(0,1);
    lcd.print("tarjeta Sd");
  } else {
    lcd.clear();
    lcd.print("Tarjeta Sd");
    lcd.setCursor(0,1);
    lcd.print("iniciada");
    delay (1500);
    lcd.clear();
  }
 
}

void loop(void) {

}


any help would be mostly appreciate, thanks so much.
userHeadPic ecangis
2016-05-07 19:15:12 Hi ecangis,

Sorry for the late reply.

I checked with the expansion shield schematic that the SPI interface are connected to Raspberry Pi's SPI interface but not leonardo, so as the IIC interface (I am not sure what kind of LCD you r using with?), could you tell me your code for SD card module?
userHeadPic Leff