4dsystem sdcard module not working- lib needed?

Hi

So i bought the 4dsystem because of the ease of implementation that it's supposed to do as just need a tx and a rx line over a comm port of the arduino. So on deluminalove and on Mega, it doesn't work. I try all sdfatlib, and other sd lib... but at the end i was just able to read or just list the file and not more.
So is anyone have a working librairy or have an small example code to use with the 4dsystem sd module ?
Thanks

Do you have a µDRIVE-uSD-G1 ?

You do not need any of those libraries. The only thing you need is serial communication. (Serial.begin and so on) The manual explains what to send and when. Top of page 5 of GOLDELOX-DOS-COMMANDS-SIS.pdf gives a nice explanation.

Jeroen

Hi

So yes, it's exactly that module, but i struggle to clearly understand it really. Like, here's the code of a thermocouple module. So basically, the serialprint function show me the value on the serial monitor.

#include <MAX6675.h> //prendre la version modifier du 8septembre !!!

#include <SdFat.h>
#include <SdFatUtil.h>

#define error(s) error_P(PSTR(s))
Sd2Card card;
SdVolume volume;
SdFile root;
SdFile file;

void error_P(const char* str) {
PgmPrint("error: ");
SerialPrintln_P(str);
if (card.errorCode()) {
PgmPrint("SD error: ");
Serial.print(card.errorCode(), HEX);
Serial.print(',');
Serial.println(card.errorData(), HEX);
}
while(1);
}
//int LED1 = 6; // Status LED Pin
int CS0 = 7; // CS pin on MAX6675
int CS1 = 8; // CS pin on MAX6675
int CS2 = 9; // CS pin on MAX6675
int CS3 = 10; // CS pin on MAX6675
int SO = 12; // SO pin of MAX6675
int SCK = 13; // SCK pin of MAX6675
int units = 1; // Units to readout temp (0 = °F, 1 = °C)
float error1 = 0; // Temperature compensation error
float error2 = 0; // Temperature compensation error
float error3 = 0; // Temperature compensation error
float error4 = 0; // Temperature compensation error
int status = 0; // Varible to control the status led

float temp[4];
char name[] = "DATA.LOG";

MAX6675 temp0(CS0,SO,SCK,units,error1);
MAX6675 temp1(CS1,SO,SCK,units,error2);
MAX6675 temp2(CS2,SO,SCK,units,error3);
MAX6675 temp3(CS3,SO,SCK,units,error4);

void setup() {
Serial.begin(19200);
PgmPrint("Free RAM: ");
Serial.println(FreeRam());
// pinMode(LED1, OUTPUT);
// if (!card.init(SPI_QUARTER_SPEED)) error("card.init failed!");
// if (!volume.init(&card)) error("vol.init failed!");
// if (!root.openRoot(&volume)) error("openRoot failed");
Serial.println("SD Card init OK");
}

void loop() {
temp[0] = temp0.read_temp(); // Read the temp and return the value
temp[1] = temp1.read_temp(); // Read the temp and return the value
temp[2] = temp2.read_temp(); // Read the temp and return the value
// temp[3] = temp3.read_temp(); // Read the temp and return the value

Serial.print(temp[0]);
Serial.print(",");
Serial.println(temp[1]);
Serial.print(",");
Serial.println(temp[2]);

// Serial.print("Temperature: \t"); // Print Header to Serial

delay(2000); // Wait one second before reading again
}

So does i have to create an empty file and or adda line to create a file when power on and after the serialprint function will go directly on that file ? That's where i'm way not sure.
thanks again

Not to be impolite but did you read the data-sheet and the command sheet?
http://www.4dsystems.com.au/downloads/micro-DRIVE/uDRIVE-uSD-G1/Docs/Pdf/uDRIVE-uSD-G1-DS-rev2.pdf and http://www.4dsystems.com.au/downloads/micro-DRIVE/uDRIVE-uSD-G1/Docs/Pdf/GOLDELOX-DOS-COMMANDS-SIS.pdf

Have you connected the hardware as figure 1 of uDRIVE-uSD-G1-DS-rev2.pdf?

first thing you have to do is a start up sequence;
-pull the reset pin low for at least 2 microseconds.
-give the module some time to settle (at least 500 milli sec)
The next important thing is to do an "Auto-Baud Setup" as they call it at chapter 2.3 and explained in chapter 3.
-start the serial port connected to the screen
-send the capital letter U (55hex)
-wait for 1 char to arrive back at the arduino.
If you have received 06hex (ACK) then everything went ok. If you have received nothing (within a second or so. not specified) or 15hex (NACK) then something went wrong and you have to do the previous again until you receive 06hex (ACK).

This is just the startup sequence. You have to do this every time you turn on the power/ do a reset of the module.

Hope that this will get you started.

Jeroen

edit: you do not need the SdFat and SdFatUtil libraries for this module

Hi

So tanks for the details. very appreciated. So yeah, i've read it, but i mostly think it was related for a microcontroller other than an arduino, that i can use some of the implement of the sdfat library. So i will test and i get back with the result.

thanks