<?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: mx31 SPI breaks between commands in Other NXP Products</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/mx31-SPI-breaks-between-commands/m-p/157017#M714</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;If you haven't, read the docs on the CSPI controller (Chapter-24) in the iMX31 Reference Manual. This is a 'configurable' SPI controller and there are numerous control bits and a 'Sample Period Control Reg' which could be the problem. The Sample Period Control-reg is a way to insert delays between consecutive SPI transfers.&lt;BR /&gt;-Mark&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jun 2008 02:54:29 GMT</pubDate>
    <dc:creator>physicseng</dc:creator>
    <dc:date>2008-06-04T02:54:29Z</dc:date>
    <item>
      <title>mx31 SPI breaks between commands</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/mx31-SPI-breaks-between-commands/m-p/157016#M713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;im writing a (kernel) SPI drivers for a camerasensor. I used the pmic drivers in the LTIB to base mine.&lt;BR /&gt;&lt;BR /&gt;The problem is now, that between SPI transfers (in one single spi_messages) there are breaks of ca. 6 - 7us. Thats very much when sending with 16 Mhz.&lt;BR /&gt;The spi send function is:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;static inline int lupa_spi_test1(struct spi_device *spi, unsigned int *buf,         unsigned int *buf1){ struct spi_transfer t = {  .tx_buf = buf,  .rx_buf = buf,  .len = 1,  .cs_change = 0,  .delay_usecs = 0, }; struct spi_transfer t1 = {  .tx_buf = buf1,  .rx_buf = buf1,  .len = 1,  .cs_change = 0,  .delay_usecs = 0, }; struct spi_message m;  spi_message_init(&amp;amp;m); spi_message_add_tail(&amp;amp;t, &amp;amp;m); spi_message_add_tail(&amp;amp;t1, &amp;amp;m); if (spi_sync(spi, &amp;amp;m) != 0 || m.status != 0)  return -1; return (2 - m.actual_length);}&lt;/PRE&gt;&lt;/DIV&gt;To call this function is use this code:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt; int i; unsigned int val = 0xFFFF; unsigned int val1 = 0xFFFF; for (i = 0; i &amp;lt; 10; i++) {  if (lupa_spi_test1(spi, &amp;amp;val, &amp;amp;val1) != 0)   printk(KERN_INFO "SPI send ERROR"); }&lt;/PRE&gt;&lt;/DIV&gt;The SPI breaks between the function calls (betweend the spi_messages) are 17 - 18us.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;Sending with spi_async instead of spi_sync could only help to reduce the breaks between the function calls but not the break between the two spi_transfers in one spi_message.&lt;BR /&gt;&lt;BR /&gt;The break between the first spi_transfers (one spi_messages) are sometimes even up to 85us.&lt;BR /&gt;&lt;BR /&gt;There dont run any programs which use much cpu. Every process uses 0.0 CPU in the "top" task manager.&lt;BR /&gt;&lt;BR /&gt;Somebody knows where the breaks come from? And how to reduce them?&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&lt;BR /&gt;Jascha&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:01:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/mx31-SPI-breaks-between-commands/m-p/157016#M713</guid>
      <dc:creator>TheRealJayJay</dc:creator>
      <dc:date>2020-10-29T09:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: mx31 SPI breaks between commands</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/mx31-SPI-breaks-between-commands/m-p/157017#M714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;If you haven't, read the docs on the CSPI controller (Chapter-24) in the iMX31 Reference Manual. This is a 'configurable' SPI controller and there are numerous control bits and a 'Sample Period Control Reg' which could be the problem. The Sample Period Control-reg is a way to insert delays between consecutive SPI transfers.&lt;BR /&gt;-Mark&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2008 02:54:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/mx31-SPI-breaks-between-commands/m-p/157017#M714</guid>
      <dc:creator>physicseng</dc:creator>
      <dc:date>2008-06-04T02:54:29Z</dc:date>
    </item>
  </channel>
</rss>

