This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Unable to write to micro SD card

Hi
I'm trying to interface with SD/micro SD cards using my LPC236
I have used the sample code in Boards/Keil/MCB2300/RL/FlashFS/SD_File and change the main function to this:

int main (void) {
  char *sp,*cp,*next;
  FILE *file;
  U32 i;
  SCS |=0x00000001;
  FIO2DIR =(1<<10);        //p2.10 is a test LED
  FIO2SET = (1<<10);
  delay_ms(2500);
  FIO2CLR=(1<<10);
  delay_ms(2500);

  init_card();
  FIO2SET=(1<<10);

  file=fopen ("Testjavad.txt","w");
  fputs("This is an example for fputs.\n", file);
  while (1)
  {

  }
}

This picture shows how I have connected my pins:
upcity.ir/.../76769829806565195328.jpg

When the 4GB micro SDHC memory is in, the power consumption of my board is increased by 100mA, but no change is made to the card
When a 256MB SD card is in, the power consumption of my board is increased by 300mA , but no change is made to the card
Also the program is stopped at init_card(); because I see the LED is OFF

Could anyone help or give me a working sample code?
I use LPC2368 and my crystal is 12MHz

Parents Reply Children
No data