SD card interface 8 bit MCU

Discussion in 'Embedded Systems and Microcontrollers' started by ashrd, Feb 19, 2009.

  1. ashrd

    Thread Starter New Member

    Jan 7, 2009
    Hello there,

    I am interfacing a SD card with MC9S08AW16 using SPI. I have a problem while initialising the SD card. I sending CMD0 and CMD1 to initialise it. The SD card is not returning any value (it should return 1 for CMD0 and 0 or CMD1).

    SPI clock is set to 357.14KHz during initilisation.

    Can anyone help me out!

  2. ahwaheed

    New Member

    Feb 25, 2009
    what are the settings of the SPI interface "Master or Slave ,...." and what is the return value from the reading spi function you use ?
  3. davebee

    Well-Known Member

    Oct 22, 2008
    I would suggest to forget about CMD1 until CMD0 correctly returns what it is supposed to (1, I think). If you did the wiring, double check it, including pullup resistors, even on the unused DAT1 and DAT2 pins, and if you did the coding, doublecheck your code. Make sure you're issuing the 80 or so initial clocks that the card is supposed to get before issuing CMD0.

    SD Cards do fail, so if everything checks out properly, try another card.