<?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 Re: K22 PE based SPI Slave TX FIFO Question in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/K22-PE-based-SPI-Slave-TX-FIFO-Question/m-p/422254#M2183</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Richard Chelminski:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you share your project so I can give it a check? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's hard to see the problem only by your description.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Nov 2015 20:41:35 GMT</pubDate>
    <dc:creator>Jorge_Gonzalez</dc:creator>
    <dc:date>2015-11-30T20:41:35Z</dc:date>
    <item>
      <title>K22 PE based SPI Slave TX FIFO Question</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/K22-PE-based-SPI-Slave-TX-FIFO-Question/m-p/422253#M2182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Community,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I wrote a fairly straight forward Transparent spi layer between a host (master) and a ADC (slave), utilizing processor expert and the latest SDK. The board I'm using is the FRDM-K22F. From the perspective of receiving a message from the host, sending it to the adc, and then receiving from the adc, I've had no issue.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem comes in when I'm attempting to send that information back to the host. The host is expecting 2 bytes, and I use the command DSPI_DRV_SlaveTransfer, with the correct instance, a non empty TX Buffer, a non null RX Buffer, a length of 2, and a timeout period that is more than generous. Through debugging I've validated this information.&lt;/P&gt;&lt;P&gt;Yet, every single time I only send 0x00 and then the first byte I have in the TX Buffer.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An example would be&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Host sends 0x0C 0x00&lt;/P&gt;&lt;P&gt;- K22 receives this, and then sends 0x0C 0x00 to the ADC&lt;/P&gt;&lt;P&gt;- ADC sends back 0x7F 0xEA&lt;/P&gt;&lt;P&gt;- K22 receives this, and then sends 0x00 0x7F to the Host&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be very welcomed.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2015 21:31:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/K22-PE-based-SPI-Slave-TX-FIFO-Question/m-p/422253#M2182</guid>
      <dc:creator>richardchelmins</dc:creator>
      <dc:date>2015-11-18T21:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: K22 PE based SPI Slave TX FIFO Question</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/K22-PE-based-SPI-Slave-TX-FIFO-Question/m-p/422254#M2183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Richard Chelminski:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you share your project so I can give it a check? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's hard to see the problem only by your description.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2015 20:41:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/K22-PE-based-SPI-Slave-TX-FIFO-Question/m-p/422254#M2183</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-11-30T20:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: K22 PE based SPI Slave TX FIFO Question</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/K22-PE-based-SPI-Slave-TX-FIFO-Question/m-p/422255#M2184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The setup code was done using ProcessorExpert with the following configuration&lt;/P&gt;&lt;P&gt;Slave: SPI1, 2Mhz Clk, 8 bits per frame, Active Low Clk, MSB First&lt;/P&gt;&lt;P&gt;Master: SPI0, 2Mhz Clk, 8 bits per frame, Active Low Clk, MSB First&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A simplified version of the code (taking out case statements and other logic) is the following &lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;uint8_t&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;*&lt;/SPAN&gt; Master&lt;SPAN class="s3"&gt;RxBuf[2]&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;uint8_t&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;*&lt;/SPAN&gt; Master&lt;SPAN class="s3"&gt;TxBuf[2]&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;uint8_t&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;*&lt;/SPAN&gt; Slave&lt;SPAN class="s3"&gt;RxBuf[2]&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;uint8_t&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;*&lt;/SPAN&gt; Slave&lt;SPAN class="s3"&gt;TxBuf[2]&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s2"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;void fooTask( &lt;/SPAN&gt;task_param_t&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;param)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;{&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DSPI_DRV_SlaveTransferBlocking&lt;SPAN class="s1"&gt;(&lt;/SPAN&gt;dspiSlave_IDX&lt;SPAN class="s3"&gt;,&lt;/SPAN&gt;&lt;SPAN class="s5"&gt; NULL&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;,&lt;/SPAN&gt;&lt;SPAN class="s5"&gt; Slave&lt;SPAN class="s3"&gt;RxBuf&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;,&lt;/SPAN&gt;&lt;SPAN class="s5"&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;2, 10)&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy(MasterTxBuff, SlaveRxBuf, 2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DSPI_DRV_MasterTransferBlocking(dspiMaster_IDX, MasterTxBuff, NULL, 2, 10);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DSPI_DRV_MasterTransferBlocking(dspiMaster_IDX, NULL, MasterRxBuff, 2, 10);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy(SlaveTxBuff, MasterRxBuf, 2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DSPI_DRV_SlaveTransferBlocking(dspiSlave_IDX, SlaveRxBuf, SlaveTxBuf, 2 , 10);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;All of this works fine up until that final Slave TX, where it puts a 0x00 and then the first byte of the real data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;See below a Saleae capture of this occurrence. 0x2C00 was received, 0x2C00 was sent out, and then 0x052C was received and only 0x0005 was sent out&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Data Transmission.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51989iACB5724114F8AEAE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Data Transmission.png" alt="Data Transmission.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 13:52:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/K22-PE-based-SPI-Slave-TX-FIFO-Question/m-p/422255#M2184</guid>
      <dc:creator>richardchelmins</dc:creator>
      <dc:date>2015-12-02T13:52:12Z</dc:date>
    </item>
  </channel>
</rss>

