<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Are there any examples for implementing an SD card with the LPC5411? in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745970#M30083</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been working with the&amp;nbsp;SDK_2.2.1_LPCXpresso54114 development kit as i m using a LPC5411 processor. I wanted to try log data on an SD card but was having difficulty in getting this setup. It seemed like the fsl_sdspi_disk driver doesn't compile with a project. Additional files are needed and when i go to include additional drivers the errors are magnified. Even if I am able to compile this, I still don't have an example for using this driver. I found an example in the&amp;nbsp;SDK_2.3.0_LPCXpresso54608-OM13588 kit for the sd card. However I m not sure if I can use this example in the&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;LPCXpresso54114&lt;/SPAN&gt; kit. It again has problems compiling.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to use the sdcard driver example from the&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;LPCXpresso54608-OM13588&lt;/SPAN&gt; kit with the LPC5411?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Mar 2018 15:48:53 GMT</pubDate>
    <dc:creator>puddletowntom</dc:creator>
    <dc:date>2018-03-28T15:48:53Z</dc:date>
    <item>
      <title>Are there any examples for implementing an SD card with the LPC5411?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745970#M30083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been working with the&amp;nbsp;SDK_2.2.1_LPCXpresso54114 development kit as i m using a LPC5411 processor. I wanted to try log data on an SD card but was having difficulty in getting this setup. It seemed like the fsl_sdspi_disk driver doesn't compile with a project. Additional files are needed and when i go to include additional drivers the errors are magnified. Even if I am able to compile this, I still don't have an example for using this driver. I found an example in the&amp;nbsp;SDK_2.3.0_LPCXpresso54608-OM13588 kit for the sd card. However I m not sure if I can use this example in the&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;LPCXpresso54114&lt;/SPAN&gt; kit. It again has problems compiling.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to use the sdcard driver example from the&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;LPCXpresso54608-OM13588&lt;/SPAN&gt; kit with the LPC5411?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 15:48:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745970#M30083</guid>
      <dc:creator>puddletowntom</dc:creator>
      <dc:date>2018-03-28T15:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any examples for implementing an SD card with the LPC5411?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745971#M30084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ronan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; LPC54114 chip don't have SD/MMC peripheral, so you'd need to access the SDcard using a standard SPI port.&lt;/P&gt;&lt;P&gt;&amp;nbsp; You can't use the LPC54608 sdcard driver example, because LPC54608 have the SD/MMC peripheral.&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you want to use the SD card in LPC54114, you need to write the SPI driver at first, then add the SD card driver based on the SPI interface.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Here have a doc about the SPI SD card, although it is not the lpc code, but the sd card operation based on the SPI is the same, you still can refer to it:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-330958"&gt;Porting FatFs file system to KL26 SPI SD card code&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2018 08:51:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745971#M30084</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-03-29T08:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any examples for implementing an SD card with the LPC5411?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745972#M30085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the response. Do you know is it possible to write to the SD card without the fatfs? It seems like writing a the SPI driver is a big job. I m assuming it would take a long time to write, or do you think writing a basic SPI driver for a basic data logger can be done in a short time period?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2018 10:00:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745972#M30085</guid>
      <dc:creator>puddletowntom</dc:creator>
      <dc:date>2018-03-29T10:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any examples for implementing an SD card with the LPC5411?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745973#M30086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Of course you can write the SD card without the fatfs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Actually, the post which I recommend you already contains the basic SD card initialization and the write, read.&lt;/P&gt;&lt;P&gt;&amp;nbsp; You just need to read the chapter: 3.3 SD I/O Layer&lt;/P&gt;&lt;P&gt;&amp;nbsp;Then, in the main file: you can call the write and read function directly, fatfs is based on the basic SD card code.&lt;/P&gt;&lt;P&gt;&amp;nbsp; About the SPI driver, you can refer to our LPC54114 sample code, both lpcopen and SDK is OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp; When you write the code, if you meet the questions, just let me know! I will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2018 08:50:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745973#M30086</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-03-30T08:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any examples for implementing an SD card with the LPC5411?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745974#M30087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This sounds good. I will try implement this next week when I get the chance. However, I was trying to understand some of the functions from the link. I see that the KL26 is using MDK5.1 software. I was trying to relate this to the&amp;nbsp;SDK_2.2_FRDM-KL26Z for porting to NXP MCUXpresso code. However, I m not sure what the equivalent functions for the following are?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;SSP0LowSpeed();&lt;BR /&gt;MMCDelayUs();&lt;BR /&gt;Send_Byte();&lt;BR /&gt;MMCWriteCmd();&lt;BR /&gt;MMCCS();&lt;BR /&gt;Get_Byte();&lt;BR /&gt;SSP0HighSpeed();&lt;/DIV&gt;&lt;DIV&gt;System_init();&lt;BR /&gt;spiInit();&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Once I understand these functions I can try it out.&lt;/DIV&gt;&lt;DIV&gt;Thank you for the response.&lt;/DIV&gt;&lt;DIV&gt;Ronan&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2018 11:51:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745974#M30087</guid>
      <dc:creator>puddletowntom</dc:creator>
      <dc:date>2018-03-30T11:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any examples for implementing an SD card with the LPC5411?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745975#M30088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ronan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I will post this function out directly, just for your reference.&lt;BR /&gt;1, SSP0LowSpeed();&lt;BR /&gt;/**************************************************************************************&lt;BR /&gt;* FunctionName&amp;nbsp;&amp;nbsp; : SSP0LowSpeed()&lt;BR /&gt;* Description&amp;nbsp;&amp;nbsp;&amp;nbsp; : SSP0 low speed = 400K&lt;BR /&gt;* EntryParameter : None&lt;BR /&gt;* ReturnValue&amp;nbsp;&amp;nbsp;&amp;nbsp; : None&lt;BR /&gt;**************************************************************************************/&lt;BR /&gt;void SSP0LowSpeed(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI0_BASE_PTR-&amp;gt;BR = 7;&lt;BR /&gt;}&lt;BR /&gt;Actually, just configure the SPI clock speed to 400K, as you know the SD card configuration have the different speed.&lt;BR /&gt;In LPC, you also can configure the low clock speed to 400K.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2, MMCDelayUs();&lt;BR /&gt;void MMCDelayUs(uint16 tt)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8 i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (tt--)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i=0; i&amp;lt;250; i++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;Just a software delay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3, Send_Byte();&lt;BR /&gt;uint8 Send_Byte (uint8 ucdata)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8 ucTemp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while((SPI0_S &amp;amp; SPI_S_SPTEF_MASK) != SPI_S_SPTEF_MASK);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI0_DL = ucdata;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while((SPI0_S &amp;amp; SPI_S_SPRF_MASK) != SPI_S_SPRF_MASK);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ucTemp = SPI0_DL;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ucTemp = ucTemp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ucTemp;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just send one byte SPI data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;4. MMCWriteCmd();&lt;BR /&gt;uint8 MMCWriteCmd( uint8 cmd, uint32 arg, uint8 crc )&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;uint16 cnt=512;&lt;BR /&gt;&amp;nbsp;uint8&amp;nbsp; sta;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MMCCS(1); //SEL high&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Send_Byte( 0xff ); //delay&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MMCCS(0); //SEL low&lt;BR /&gt;&amp;nbsp;if ( sd_Enable_Select() )&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; return 0xff; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Send_Byte( cmd | 0x40 ); &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Send_Byte( (uint8)(arg&amp;gt;&amp;gt;24) );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Send_Byte( (uint8)(arg&amp;gt;&amp;gt;16) );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Send_Byte( (uint8)(arg&amp;gt;&amp;gt;8) );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Send_Byte( (uint8)(arg) );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Send_Byte( crc );&amp;nbsp;&amp;nbsp; // CRC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;do&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; sta = Send_Byte( 0xff );&lt;BR /&gt;&amp;nbsp; cnt--;&lt;BR /&gt;&amp;nbsp;} while ( (cnt)&amp;amp;&amp;amp;(sta==0xff) );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;return sta;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;__inline static void sd_Disable_Select( void )&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;MMCCS(1);&amp;nbsp;&amp;nbsp;&amp;nbsp; // &lt;BR /&gt;&amp;nbsp;Send_Byte( 0xff ); // &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__inline static uint8 sd_Enable_Select( void )&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;MMCCS(0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &lt;BR /&gt;&amp;nbsp;if ( sd_WaitRead() == 0 ) // ??SD/MMC??&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; return 0;&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;sd_Disable_Select(); &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;return 1;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;uint8&amp;nbsp; sd_WaitRead( void )&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;uint32 cnt = 0x00fffff;&lt;BR /&gt;&amp;nbsp;uint8&amp;nbsp; sta;&lt;BR /&gt;&amp;nbsp;do &lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; sta = Send_Byte( 0xff );;&lt;BR /&gt;&amp;nbsp; if ( sta == 0xff ) // &lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; return 0;&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; cnt--;&lt;BR /&gt;&amp;nbsp;} while ( cnt );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;return 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. MMCCS();&lt;BR /&gt;void MMCCS(uint8 cs)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (cs == 1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MMC_CS_SET();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // SS=1 &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;else&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MMC_CS_CLR();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // SS=0 &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just control SPI_SEL pin high or low level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6 Get_Byte();&lt;BR /&gt;uint8&amp;nbsp; Get_Byte (void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8 ucTemp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while((SPI0_S &amp;amp; SPI_S_SPTEF_MASK) != SPI_S_SPTEF_MASK);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI0_DL = 0xff;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while((SPI0_S &amp;amp; SPI_S_SPRF_MASK) != SPI_S_SPRF_MASK);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ucTemp = SPI0_DL;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (ucTemp);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;}&lt;BR /&gt;Read one SPI byte data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. SSP0HighSpeed();&lt;BR /&gt;void SSP0HighSpeed(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI0_BASE_PTR-&amp;gt;BR = 2;&lt;BR /&gt;}&lt;BR /&gt;Set high clock speed, to 24Mhz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8. System_init();&lt;BR /&gt;MCU chip system initial, you just use the LPC system initial code is OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9. spiInit();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just need to use the LPC SPI initilization code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2018 09:03:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745975#M30088</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-04-02T09:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any examples for implementing an SD card with the LPC5411?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745976#M30089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Kerry,&lt;/DIV&gt;&lt;DIV&gt;I just have a few more questions. For the MMCWriteCmd() function you have&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;MMCCS(1); //SEL high&lt;BR /&gt;&amp;nbsp;Send_Byte( 0xff ); //delay&lt;BR /&gt;&amp;nbsp;MMCCS(0); //SEL low&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Should this not be&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;MMCCS(0); //SEL high&lt;BR /&gt;&amp;nbsp;Send_Byte( 0xff ); //delay&lt;BR /&gt;&amp;nbsp;MMCCS(1); //SEL low&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I thought the Chip Select needed to be pulled low when sending a byte over SPI?&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I was also trying to figure out what the CMD values are for the SD card. I found a source(&lt;A href="http://www.dejazzer.com/ee379/lecture_notes/lec12_sd_card.pdf"&gt;http://www.dejazzer.com/ee379/lecture_notes/lec12_sd_card.pdf&lt;/A&gt;) on some of the CMD values, eg&lt;/DIV&gt;&lt;DIV&gt;CMD0 (40 00 00 00 00 95) --&amp;gt; 01000000 00000000 00000000 00000000 00000000 10010101 &lt;BR /&gt;CMD8 (48 00 00 01 AA 0F)--&amp;gt; 01001000 00000000 00000000 00000001 10101010 00001111 &lt;BR /&gt;CMD58 (7A 00 00 00 00 75)--&amp;gt; 01 111010 00000000 00000000 00000000 00000000 0111010 1&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;The blog post that you directed me towards has the following,&lt;/DIV&gt;&lt;DIV&gt;MMCWriteCmd(CMD0,0x00,0x95);&lt;BR /&gt;MMCWriteCmd( CMD8,0x1AA,0x87 );&lt;BR /&gt;MMCWriteCmd(CMD58, 0, 0 );&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I m assuming the function sends 48bits? Does this mean that CMD0 = 0x40,&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;CMD8&lt;/SPAN&gt; = 48 and&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;CMD58 = 7A?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I m not sure where I can find the values for the following definitions,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;#define CMD0 0x40 //Use SPI interface&lt;BR /&gt;#define CMD8 0x48 //Get SD card version&lt;BR /&gt;#define CMD9 &lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;?&lt;/SPAN&gt; //Read CSD, get other information,&lt;BR /&gt;#define CMD12 ?&lt;BR /&gt;#define CMD16 &lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;?&lt;/SPAN&gt; //Set SD card block size to 512Byte.&lt;BR /&gt;#define CMD17 ?//For reading the SD card send to this&lt;BR /&gt;#define CMD18 &lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;?&lt;/SPAN&gt;&lt;BR /&gt;#define CMD24&amp;nbsp;? //For writing to the SD card send to this&lt;BR /&gt;#define CMD41 &lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;?&lt;/SPAN&gt; //Activate SD card&lt;BR /&gt;#define CMD55 &lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;?&lt;/SPAN&gt; //Activate SD card&lt;BR /&gt;#define CMD58 &lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;?&lt;/SPAN&gt;&lt;BR /&gt;#define CMD59 ?//Read OCR data&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Thank you,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Ronan&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2018 10:46:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745976#M30089</guid>
      <dc:creator>puddletowntom</dc:creator>
      <dc:date>2018-04-10T10:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any examples for implementing an SD card with the LPC5411?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745977#M30090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In addition, I m not entirely sure how the Send_Byte() and Get_Byte() functions are implemented. Previously using SPI, I have been using something similar to the examples for sending and receiving byte values. eg if I implemented my Send_Byte() in the same way it would look something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;uint8_t Send_Byte(uint8_t byte_val){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; spi_transfer_t xfer = {0};&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; status_t xferStatus = kStatus_Success;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t ucTemp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;srcBuff[0] = byte_val;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xfer.txData = srcBuff;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xfer.rxData = destBuff;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xfer.dataSize = sizeof(destBuff);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;SPI_CS_Low();&lt;BR /&gt;&amp;nbsp;xferStatus = SPI_MasterTransferBlocking(EXAMPLE_SPI_MASTER, &amp;amp;xfer);&lt;BR /&gt;&amp;nbsp;SPI_CS_High();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;ucTemp = destBuff[0];&lt;BR /&gt;&amp;nbsp;return ucTemp;&lt;BR /&gt;}&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;However, I m not sure if this is right.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&amp;nbsp;xferStatus = SPI_MasterTransferBlocking(EXAMPLE_SPI_MASTER, &amp;amp;xfer);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Could you explain where you got the values in the following function&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;uint8 Send_Byte (uint8 ucdata)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8 ucTemp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while((SPI0_S &amp;amp; SPI_S_SPTEF_MASK) != SPI_S_SPTEF_MASK);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPI0_DL = ucdata;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while((SPI0_S &amp;amp; SPI_S_SPRF_MASK) != SPI_S_SPRF_MASK);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ucTemp = SPI0_DL;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ucTemp = ucTemp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ucTemp;&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I don't understand the definition of&amp;nbsp;SPI0_S,&amp;nbsp;SPI_S_SPTEF_MASK,&amp;nbsp;SPI_S_SPTEF_MASK and&amp;nbsp;SPI0_DL?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Thank you,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Ronan&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2018 14:56:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745977#M30090</guid>
      <dc:creator>puddletowntom</dc:creator>
      <dc:date>2018-04-10T14:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any examples for implementing an SD card with the LPC5411?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745978#M30091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ronan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sorry for my later reply, really a little overloaded recently.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Because that code is for kinetis, the register is not the same, may make you feel confused.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&amp;nbsp;SPI0_S&lt;/SPAN&gt; is the status register, &lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;SPI_S_SPTEF_MASK&lt;/SPAN&gt; is the SPI transfer status, SPI0_DL is the data register.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I find you already create the new post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/473748"&gt;Talk to an SD card via SPI?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; You mentioned, you already send the according SD command to the SD card via the SPI interface.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Please reply me in your new post, send me your test project, I will test it on my LPC5411X and SD card.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2018 07:06:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745978#M30091</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-04-16T07:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any examples for implementing an SD card with the LPC5411?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745979#M30092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the late response. I was busy working on other things so I parked aside the work I was doing on the SD card. I managed to get basic reading and writing to the sd card working (and initialisation of course). I ll probably post the code here for others if they want it. However, even though I can use what I have as a basic data logger, I would still like to have a file system set up so that I can download saved files from the SD card. It appears that I need to integrate what I have with the Fatfs. I just have a few questions on this. With my current set up it seems that I need to edit the diskio.c file for the low level I/O control using the functions&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;disk_status(),&lt;/P&gt;&lt;P&gt;disk_initialize(),&lt;/P&gt;&lt;P&gt;disk_read(),&lt;/P&gt;&lt;P&gt;disk_write(),&lt;/P&gt;&lt;P&gt;disk_ioctl()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did notice that in the middleware folder of the sdk (SDK_2.2.1_LPCXpresso54114\middleware\fatfs_0.12b\src\fsl_sdspi_disk) there is the file fsl_sdspi_disk.c. Can this be used as the diskio.c file with LPC5411?. I m having a little problem implementing the diskio.c file myself. The previous code you gave me which included the functions MMCInit(),&amp;nbsp;MMCWriteCmd(),&amp;nbsp;MMCReadSingleBlock(),&amp;nbsp;MMCWriteSingleBlock(). Would these just be put into the disk functions&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;disk_initialize(),disk_write(),&amp;nbsp;disk_read()?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Ronan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2018 13:48:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745979#M30092</guid>
      <dc:creator>puddletowntom</dc:creator>
      <dc:date>2018-05-23T13:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Are there any examples for implementing an SD card with the LPC5411?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745980#M30093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I actually forgot that the blog you posted gave information on setting up the diskio.c file. I was able to make more progress with this. However I m now stuck on an issue which involves running the f_open() function. Its fails after returning the&amp;nbsp;FR_NO_FILESYSTEM (no valid FAT volume) error. I tried formating the SD card in a number of variations of the FATFS but to no luck. Looking deeper into this problem, it seems as though the issue is caused when checking the boot record signature in the ff.c file. eg&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(ld_word(fs-&amp;gt;win + BS_55AA) != 0xAA55) return 3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the boot record signature does not result with the value&amp;nbsp;&lt;TT style="color: #222222; background-color: transparent; text-decoration: none; font-size: 13.93px;"&gt;0xAA55&lt;/TT&gt;&lt;SPAN style="color: #222222; background-color: transparent; text-decoration: none; font-size: 13.93px;"&gt;&amp;nbsp;it returns a 3 which in turn results in the no valid FAT volume error (&lt;SPAN style="color: #3d3d3d;"&gt;FR_NO_FILESYSTEM&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;). My assumption is that this doesnt have anything to do with the I/O low level diskio stuff but has to do with the format.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: transparent; text-decoration: none; font-size: 13.93px;"&gt;Does anybody know if the architecture of the LPC5411 is little endian or big endian? I couldnt find this on the datasheet. Reading the elm chan blog there is information about the FATFS being little endian and the need for conversion if using big endian architecture.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://elm-chan.org/docs/fat_e.html" title="http://elm-chan.org/docs/fat_e.html"&gt;FAT Filesystem&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 17:10:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Are-there-any-examples-for-implementing-an-SD-card-with-the/m-p/745980#M30093</guid>
      <dc:creator>puddletowntom</dc:creator>
      <dc:date>2018-05-24T17:10:53Z</dc:date>
    </item>
  </channel>
</rss>

