<?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 SPI - slave mode in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-slave-mode/m-p/532941#M3334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tyassin on Tue Nov 12 07:16:35 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a communication between two MCUs: LPC1114 and LPC11A12. The slave device seems to be receiving the same data that is supposed to be sent! I have attached the code below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;void SSP_Send_Receive( uint8_t* buf, uint8_t length )
{
&amp;nbsp; uint8_t i;

&amp;nbsp; for ( i = 0; i &amp;lt; length; i++ )
&amp;nbsp; {
&amp;nbsp; LPC_SSP1-&amp;gt;DR = *buf++;
//&amp;nbsp; while(!(LPC_SSP1-&amp;gt;SR &amp;amp; SSPSR_BSY));
//&amp;nbsp; while ( (LPC_SSP1-&amp;gt;SR &amp;amp; (SSPSR_BSY|SSPSR_RNE)) != SSPSR_RNE );
//&amp;nbsp; while(!(LPC_SSP1-&amp;gt;SR &amp;amp; SSPSR_RFF));
&amp;nbsp; while ( !(LPC_SSP1-&amp;gt;SR &amp;amp; SSPSR_RNE) );
&amp;nbsp; /* Wait until the Busy bit is cleared */

&amp;nbsp; Spi_receive_buffer&lt;I&gt; = LPC_SSP1-&amp;gt;DR;
&amp;nbsp; }
}&lt;/I&gt;&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I supply the function with an array consisting of 0xDD, 0xEE, and 0xFF. After I have called the function I use the UART to see whet is in "Spi_receive_buffer".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then it writes out 0xDD, 0xEE and 0xFF and I know something else is sent from the Master. Anybody have an idea what might be the problem? As you can see I have tried with different status register bits but nothing have helped.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 23:07:50 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T23:07:50Z</dc:date>
    <item>
      <title>SPI - slave mode</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-slave-mode/m-p/532941#M3334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tyassin on Tue Nov 12 07:16:35 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a communication between two MCUs: LPC1114 and LPC11A12. The slave device seems to be receiving the same data that is supposed to be sent! I have attached the code below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;void SSP_Send_Receive( uint8_t* buf, uint8_t length )
{
&amp;nbsp; uint8_t i;

&amp;nbsp; for ( i = 0; i &amp;lt; length; i++ )
&amp;nbsp; {
&amp;nbsp; LPC_SSP1-&amp;gt;DR = *buf++;
//&amp;nbsp; while(!(LPC_SSP1-&amp;gt;SR &amp;amp; SSPSR_BSY));
//&amp;nbsp; while ( (LPC_SSP1-&amp;gt;SR &amp;amp; (SSPSR_BSY|SSPSR_RNE)) != SSPSR_RNE );
//&amp;nbsp; while(!(LPC_SSP1-&amp;gt;SR &amp;amp; SSPSR_RFF));
&amp;nbsp; while ( !(LPC_SSP1-&amp;gt;SR &amp;amp; SSPSR_RNE) );
&amp;nbsp; /* Wait until the Busy bit is cleared */

&amp;nbsp; Spi_receive_buffer&lt;I&gt; = LPC_SSP1-&amp;gt;DR;
&amp;nbsp; }
}&lt;/I&gt;&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I supply the function with an array consisting of 0xDD, 0xEE, and 0xFF. After I have called the function I use the UART to see whet is in "Spi_receive_buffer".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then it writes out 0xDD, 0xEE and 0xFF and I know something else is sent from the Master. Anybody have an idea what might be the problem? As you can see I have tried with different status register bits but nothing have helped.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:07:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-slave-mode/m-p/532941#M3334</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:07:50Z</dc:date>
    </item>
  </channel>
</rss>

