<?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: lpspi_interrupt_b2b_master example code concerns in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/lpspi-interrupt-b2b-master-example-code-concerns/m-p/1180207#M11169</link>
    <description>&lt;P&gt;Hi, jeremyzhou,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for the prompt clarification!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2020 15:55:57 GMT</pubDate>
    <dc:creator>patrick_yang</dc:creator>
    <dc:date>2020-11-09T15:55:57Z</dc:date>
    <item>
      <title>lpspi_interrupt_b2b_master example code concerns</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/lpspi-interrupt-b2b-master-example-code-concerns/m-p/1179777#M11152</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;The lpspi_interrupt_b2b_master.c example code confused me about the transfer data frame size and transfer fifo size.&lt;/P&gt;&lt;P&gt;In&amp;nbsp;LPSPI_MasterInit(), the TCR is configured to be the default data frame size, which is 8.&amp;nbsp; Did not find other statements to change the data frame size to word or 32 bits.&amp;nbsp; Also&lt;/P&gt;&lt;P&gt;g_masterFifoSize = LPSPI_GetRxFifoSize(EXAMPLE_LPSPI_MASTER_BASEADDR);&lt;/P&gt;&lt;P&gt;where g_masterFifoSize is 16, which shall be 16 * 4 = 64 bytes per the NXP explanation:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-RT/iMX-RT1064-LPSPI-Maximum-FIFO-Size/m-p/915843" target="_blank"&gt;https://community.nxp.com/t5/i-MX-RT/iMX-RT1064-LPSPI-Maximum-FIFO-Size/m-p/915843&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are the confusion statements in the code:&lt;/P&gt;&lt;P&gt;/* Fill up the TX data in FIFO. */&lt;BR /&gt;while ((LPSPI_GetTxFifoCount(EXAMPLE_LPSPI_MASTER_BASEADDR) &amp;lt; g_masterFifoSize) &amp;amp;&amp;amp;&lt;BR /&gt;(masterTxCount - masterRxCount &amp;lt; g_masterFifoSize))&lt;BR /&gt;{&lt;BR /&gt;/*Write the word to TX register*/&lt;BR /&gt;LPSPI_WriteData(EXAMPLE_LPSPI_MASTER_BASEADDR, masterTxData[masterTxCount]);&lt;BR /&gt;++masterTxCount;&lt;/P&gt;&lt;P&gt;if (masterTxCount == TRANSFER_SIZE)&lt;BR /&gt;{&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Per the commend, the&amp;nbsp;LPSPI_WriteData() write a word instead of a byte each time.&amp;nbsp; Per the statements ++masterTxCount; and&amp;nbsp;if (masterTxCount == TRANSFER_SIZE), the&amp;nbsp;LPSPI_WriteData() seems write a byte each time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If LPSPI_WriteData() writes a byte each time and the FIFO buffer size is 64 bytes or 16 words, why using (masterTxCount - masterRxCount &amp;lt; g_masterFifoSize)?&amp;nbsp; Should it be (masterTxCount - masterRxCount &amp;lt; g_masterFifoSize * 4)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for any responses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 01:46:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/lpspi-interrupt-b2b-master-example-code-concerns/m-p/1179777#M11152</guid>
      <dc:creator>patrick_yang</dc:creator>
      <dc:date>2020-11-09T01:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: lpspi_interrupt_b2b_master example code concerns</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/lpspi-interrupt-b2b-master-example-code-concerns/m-p/1179954#M11162</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;Firstly, the FIFO depth is 16, and it can store up to 64 bytes, secondly, both 8-bit and 16-bit writes of transmitting data will zero-extend the data written and push the data into the transmit FIFO which is as same as write 32 bit to TDR register.&lt;BR /&gt;Hope this is clear.&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 08:02:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/lpspi-interrupt-b2b-master-example-code-concerns/m-p/1179954#M11162</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2020-11-09T08:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: lpspi_interrupt_b2b_master example code concerns</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/lpspi-interrupt-b2b-master-example-code-concerns/m-p/1180207#M11169</link>
      <description>&lt;P&gt;Hi, jeremyzhou,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for the prompt clarification!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 15:55:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/lpspi-interrupt-b2b-master-example-code-concerns/m-p/1180207#M11169</guid>
      <dc:creator>patrick_yang</dc:creator>
      <dc:date>2020-11-09T15:55:57Z</dc:date>
    </item>
  </channel>
</rss>

