AnsweredAssumed Answered

Is there any example program for interfacing sd card using SPI for LPC Xpresso 4367 board?

Question asked by Shreyas Waichal on Jun 5, 2019
Latest reply on Jun 5, 2019 by jeremyzhou

I have an SPI sd card board and want to interface it to LPC 4367.

There is an example of LPCOpen with SDIO interface but not with SPI.

Also in the SDIO in LPC Open it says that the CD and DATA3 pin needs to be connected to different pins on the board. However, the pin diagram of a sd card says that the CD and DATA3 pin are the same. So how do I connect it then?

The snippet is: 


void Board_SDMMC_Init(void)
Chip_SCU_PinMuxSet(0x1, 9, SDIO_DAT_PINCFG); /* P1.9 connected to SDIO_D0 */
Chip_SCU_PinMuxSet(0x1, 10, SDIO_DAT_PINCFG); /* P1.10 connected to SDIO_D1 */
Chip_SCU_PinMuxSet(0x1, 11, SDIO_DAT_PINCFG); /* P1.11 connected to SDIO_D2 */
Chip_SCU_PinMuxSet(0x1, 12, SDIO_DAT_PINCFG); /* P1.12 connected to SDIO_D3 */

Chip_SCU_ClockPinMuxSet(2, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC4)); /* CLK2 connected to SDIO_CLK */
Chip_SCU_PinMuxSet(0x1, 6, SDIO_DAT_PINCFG); /* P1.6 connected to SDIO_CMD */
Chip_SCU_PinMuxSet(0x1, 13, (SCU_MODE_INBUFF_EN | SCU_MODE_FUNC7)); /* P1.13 connected to SDIO_CD */




Any help would be really appreciated.