Content originally posted in LPCWare by Dave on Tue Oct 23 13:02:18 MST 2012
Okay, I took a look at the schematic - it shows the SD card is connected to the SPI bus, and that there is no GPIO input to indicate that the card is present or not...
The MCI example code won't work here, because the card is connected to the SPI bus, not the MCI bus...
You are going to have to write a driver for the SPI bus, and then you are going to need to either write a FS or use one like Chan's to talk to the drive.
Notice that the SPI bus is #1, so your pin configuration should look something like this:
<code>
// pin configuration...
LPC_IOCON->P4_20 |= 3; // SSP1_SCLK
LPC_GPIO1->DIR |= (1<<12); // SD \CS
LPC_GPIO1->SET |= (1<<12); // ...
LPC_IOCON->P4_22 |= 3; // SSP1_MISO
LPC_IOCON->P4_23 |= 3; // SSP1_MOSI
</code>