<?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>LPCXpresso IDEのトピックRe: SPI LPCXpresso example code</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-LPCXpresso-example-code/m-p/561290#M16269</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by embd02161991 on Thu Aug 22 22:48:00 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Whenever there is data in the Rx FIFO , the software would set RNE to 1 and this data would be read. This data would not be your required data .During this period any incoming data will be lost. In order to avoid this situation , the receiver FIFO is initially cleared before enabling the interrupts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;KS &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 23:39:13 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T23:39:13Z</dc:date>
    <item>
      <title>SPI LPCXpresso example code</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-LPCXpresso-example-code/m-p/561288#M16267</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 Thu Aug 22 05:50:30 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just have a question about this piece of code from the SPI example for the LPC1114.&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_Init( void )
{
 uint8_t i, Dummy=Dummy;

 /* Set DSS data to 8-bit, Frame format SPI, CPOL = 0, CPHA = 0, and SCR is 15 */
 LPC_SSP0-&amp;gt;CR0 = 0x0707;

 /* SSPCPSR clock prescale register, master mode, minimum divisor is 0x02 */
 LPC_SSP0-&amp;gt;CPSR = 16;

 for ( i = 0; i &amp;lt; FIFOSIZE; i++ )
 {
&amp;nbsp;&amp;nbsp; Dummy = LPC_SSP0-&amp;gt;DR;/* clear the RxFIFO */
 }

 /* Enable the SSP Interrupt */
 //NVIC_EnableIRQ(SSP0_IRQn);

 /* Device select as master, SSP Enabled */
 #if SSP_SLAVE
 /* Slave mode */
 if ( LPC_SSP0-&amp;gt;CR1 &amp;amp; SSPCR1_SSE )
 {
&amp;nbsp;&amp;nbsp; /* The slave bit can't be set until SSE bit is zero. */
&amp;nbsp;&amp;nbsp; LPC_SSP0-&amp;gt;CR1 &amp;amp;= ~SSPCR1_SSE;
 }
 LPC_SSP0-&amp;gt;CR1 = SSPCR1_MS;/* Enable slave bit first */
 LPC_SSP0-&amp;gt;CR1 |= SSPCR1_SSE;/* Enable SSP */
 #else
 /* Master mode */
 LPC_SSP0-&amp;gt;CR1 = SSPCR1_SSE;
 #endif
 /* Set SSPINMS registers to enable interrupts */
 /* enable all error related interrupts */
 LPC_SSP0-&amp;gt;IMSC = SSPIMSC_RORIM | SSPIMSC_RTIM;

}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The bit I wonder about is why is it necessary to clear the FIFO at startup??&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;for ( i = 0; i &amp;lt; FIFOSIZE; i++ )
 {
&amp;nbsp;&amp;nbsp; Dummy = LPC_SSP0-&amp;gt;DR;/* clear the RxFIFO */
 }&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&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:39:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-LPCXpresso-example-code/m-p/561288#M16267</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: SPI LPCXpresso example code</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-LPCXpresso-example-code/m-p/561289#M16268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by graynomad on Thu Aug 22 16:45:50 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know if it's strictly necessary with this hardware, I would assume (maybe incorrectly) that all appropriate registers and counters are zeroed at reset, but it's probably good practice and doesn't do any harm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;_____&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:39:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-LPCXpresso-example-code/m-p/561289#M16268</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: SPI LPCXpresso example code</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-LPCXpresso-example-code/m-p/561290#M16269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by embd02161991 on Thu Aug 22 22:48:00 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Whenever there is data in the Rx FIFO , the software would set RNE to 1 and this data would be read. This data would not be your required data .During this period any incoming data will be lost. In order to avoid this situation , the receiver FIFO is initially cleared before enabling the interrupts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;KS &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:39:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-LPCXpresso-example-code/m-p/561290#M16269</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: SPI LPCXpresso example code</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-LPCXpresso-example-code/m-p/561291#M16270</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 Fri Aug 23 05:35:19 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;OK I understand, but why is it cleared in the for-loop, times x FIFO size? Is it not only one register?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:39:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-LPCXpresso-example-code/m-p/561291#M16270</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:39:13Z</dc:date>
    </item>
  </channel>
</rss>

