Can't write on a MicroSD card

06 Mar 2011

Hi,

I use a MicroSD breakout board from Cool Component with my MBED.

/media/uploads/okaydjo2/transflash_breakout_board.jpg

I make the wiring between the MicroSD Breakout Board and the MBED

RSV : unconnected

CS\ : P8

DI : P5 (MOSI)

VDD : P40 (VOUT = 3.3V)

CLK : P7 (SLK)

VSS : P0 (GND)

DO : P6 (MISO)

RSV : unconnected

S1 and S2 unconnected

I use the programm SDFileSystem_Hello_World-main.cpp with the SDFileSystem Library (SPI mode for the Micro SDcard).

************

include "mbed.h"

include "SDFileSystem.h"

SDFileSystem sd(p5, p6, p7, p8, "sd"); Broche en fonction de la maquette de test

int main() {

printf("Hello World!\n");

mkdir("/sd/votredir", 0777); Creation du repertoire votredir

FILE *fp = fopen("/sd/votredir/fichier.txt", "w"); Creation d'un fichier texte nomme fichier

if(fp == NULL) { error("Le fichier ne peut pas etre ouvert pour ecrire dedans \n"); }

fprintf(fp, "Bonjour les gars !\n\r La partie programmation est difficile !\n\r on va ecrire dans la microSD de 2 Go de Marque DANE ELEC\n\r");

fclose(fp);

printf("Goodbye World!\n");

} *************

My microSD card is Dane Elec with capacity : 2 Go

My problem : I can't write a file in the MicroSD card with this Breakout Board.

So, I try this programm with the same MicroSD card associated with a workshop breakout board (Cool Component) and it's ok for writing the file !

/media/uploads/okaydjo2/workshop_dev_board.jpeg

Someone can help me for the MicroSD breakout board ?

Thanks

06 Mar 2011

Try decoupling capacitors soldered NEAR the sd card, between VCC ( +3.3V) and ground. If you follow the experience of http://www.roland-riegel.de/sd-reader/index.html , solder 50microF and 100nF Look at the schema. Robert