SD card interfacing

Hi,

I have written SD & SDHC card routine for reading, writing and erasing data from SD card. It used the hardware SPI of nRF51822.

NOTE:

1)Define the PINs of SD card first before initialing.

2)Define MOSI, MISO and SCK pins only, define the CS pin to some other pin that is not being used( these pin are define in spi_master_config.h )

3)CS pin should be separately define in SD_Routines.c by the name #define MMCSD_PIN_SELECT 29

4)If you are facing problem in using my library then first test you SPI separately.

SD_Routines.c SD_Routines.h

Parents
  • Thanks a lot for sharing these routines. This saves me a lot of time!

    I think I found a small error in the read and write functions. For an SDHC card the address equals the sector number. For SDSC cards the address equals the sector number multiplied by 512. The current code is targeted to SDSC cards only.

Comment
  • Thanks a lot for sharing these routines. This saves me a lot of time!

    I think I found a small error in the read and write functions. For an SDHC card the address equals the sector number. For SDSC cards the address equals the sector number multiplied by 512. The current code is targeted to SDSC cards only.

Children
No Data