<?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>LPC MicrocontrollersのトピックWrites to SSP1DR failing on SSP1</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writes-to-SSP1DR-failing-on-SSP1/m-p/630768#M24812</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using an LPC2478 and it appears as though the SSP1 device does not function correctly. &amp;nbsp;I am attempting to use the SSP1 device in SPI mode as a SPI slave. &amp;nbsp;I have configured the device to work as a SPI slave and have connected the four SPI lines to a FTDI chip which is then connected via USB to a PC. &amp;nbsp;The FTDI chip acts as a SPI master and then sends data to the PC via USB. &amp;nbsp;Everything is working almost as expected. &amp;nbsp;I am able to send data in both directions and can see the data being sent and received correctly most of the time. &amp;nbsp;In fact, the data seems to transfer of over SPI correctly every time but once in every 32 to 64 bytes the transmit FIFO in the SSP1 device appears to be missing a byte that was sent to it and therefore also misses sending that byte over SPI and instead sends a later byte that should follow the bytes intended to be sent. &amp;nbsp;For example, if I am trying to write consecutive values such as 0x00 through 0x10 to the SSP1 transmit FIFO (SSP1DR), I occasionally see that one of the writes to SSP1DR fails. &amp;nbsp;In my interrupt service routine, I write values to SSP1DR until the bit is flipped that says the FIFO is full. &amp;nbsp;Usually I can write 8 bytes and then the FIFO says that it is full. &amp;nbsp;When that happens I get bytes 0x00 through 0x07 sent to the master. &amp;nbsp;But sometimes the code does 9 writes to the FIFO before the FIFO says it's full. &amp;nbsp;And it appears that one of the writes to SSP1DR failed which is why the 9th write is required in order to fill the FIFO. &amp;nbsp;When that happens, the master receives 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08. &amp;nbsp;As you can see, 8 bytes get transferred but the value 0x03 appears to have never gotten put into the FIFO and instead an extra write to the FIFO added 0x08 which does get transferred. &amp;nbsp;In short, it appears that writes to SSP1DR occasionally fail. &amp;nbsp;The FIFO correctly reports that it is not full until 8 bytes get written to it but sometimes it requires 9 writes to fill the FIFO because one of the writes failed. &amp;nbsp;The SPI transmissions always seem to work but the population of the transmit FIFO does not always work correctly. &amp;nbsp;I have attached the code module that includes the SPI setup and the interrupt service routine as well as the other SPI related routines. &amp;nbsp; Any help would be much appreciated. &amp;nbsp;Also, I can add any further detail if I have left out any important points. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338014"&gt;SPISlaveSupport.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Nov 2016 23:51:48 GMT</pubDate>
    <dc:creator>eddiejakobitz</dc:creator>
    <dc:date>2016-11-28T23:51:48Z</dc:date>
    <item>
      <title>Writes to SSP1DR failing on SSP1</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writes-to-SSP1DR-failing-on-SSP1/m-p/630768#M24812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using an LPC2478 and it appears as though the SSP1 device does not function correctly. &amp;nbsp;I am attempting to use the SSP1 device in SPI mode as a SPI slave. &amp;nbsp;I have configured the device to work as a SPI slave and have connected the four SPI lines to a FTDI chip which is then connected via USB to a PC. &amp;nbsp;The FTDI chip acts as a SPI master and then sends data to the PC via USB. &amp;nbsp;Everything is working almost as expected. &amp;nbsp;I am able to send data in both directions and can see the data being sent and received correctly most of the time. &amp;nbsp;In fact, the data seems to transfer of over SPI correctly every time but once in every 32 to 64 bytes the transmit FIFO in the SSP1 device appears to be missing a byte that was sent to it and therefore also misses sending that byte over SPI and instead sends a later byte that should follow the bytes intended to be sent. &amp;nbsp;For example, if I am trying to write consecutive values such as 0x00 through 0x10 to the SSP1 transmit FIFO (SSP1DR), I occasionally see that one of the writes to SSP1DR fails. &amp;nbsp;In my interrupt service routine, I write values to SSP1DR until the bit is flipped that says the FIFO is full. &amp;nbsp;Usually I can write 8 bytes and then the FIFO says that it is full. &amp;nbsp;When that happens I get bytes 0x00 through 0x07 sent to the master. &amp;nbsp;But sometimes the code does 9 writes to the FIFO before the FIFO says it's full. &amp;nbsp;And it appears that one of the writes to SSP1DR failed which is why the 9th write is required in order to fill the FIFO. &amp;nbsp;When that happens, the master receives 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08. &amp;nbsp;As you can see, 8 bytes get transferred but the value 0x03 appears to have never gotten put into the FIFO and instead an extra write to the FIFO added 0x08 which does get transferred. &amp;nbsp;In short, it appears that writes to SSP1DR occasionally fail. &amp;nbsp;The FIFO correctly reports that it is not full until 8 bytes get written to it but sometimes it requires 9 writes to fill the FIFO because one of the writes failed. &amp;nbsp;The SPI transmissions always seem to work but the population of the transmit FIFO does not always work correctly. &amp;nbsp;I have attached the code module that includes the SPI setup and the interrupt service routine as well as the other SPI related routines. &amp;nbsp; Any help would be much appreciated. &amp;nbsp;Also, I can add any further detail if I have left out any important points. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338014"&gt;SPISlaveSupport.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 23:51:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Writes-to-SSP1DR-failing-on-SSP1/m-p/630768#M24812</guid>
      <dc:creator>eddiejakobitz</dc:creator>
      <dc:date>2016-11-28T23:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Writes to SSP1DR failing on SSP1</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writes-to-SSP1DR-failing-on-SSP1/m-p/630769#M24813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eddie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could take a look at the following links, which provides solutions/workarounds to similar behaviors:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://www.lpcware.com/content/forum/using-ssp-interrupts-and-fifo"&gt;https://www.lpcware.com/content/forum/using-ssp-interrupts-and-fifo&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://www.lpcware.com/content/forum/ssp-spi-slave-mode-how-flush-transmit-fifo"&gt;https://www.lpcware.com/content/forum/ssp-spi-slave-mode-how-flush-transmit-fifo&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://www.lpcware.com/content/forum/ssp-spi-slave-mode-sspx-status-register-reports-fifo-empty-data-lags-8-bytes-behind"&gt;https://www.lpcware.com/content/forum/ssp-spi-slave-mode-sspx-status-register-reports-fifo-empty-data-lags-8-bytes-behind&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Hope this will be useful for you.&lt;BR /&gt;Best regards!&lt;BR /&gt;/Carlos&lt;BR /&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>Wed, 21 Dec 2016 18:02:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Writes-to-SSP1DR-failing-on-SSP1/m-p/630769#M24813</guid>
      <dc:creator>CarlosCasillas</dc:creator>
      <dc:date>2016-12-21T18:02:30Z</dc:date>
    </item>
  </channel>
</rss>

