<?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>MQX Software SolutionsのトピックMOSI stays high after data transfer</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MOSI-stays-high-after-data-transfer/m-p/371565#M12265</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the k40 and I am trying to communicate with another chip from Linear Technology. I am looking at the SPI signals coming out of the k40 and I notice that the MOSI pin stays high after the data has been sent out. I want it to remain low after data transmission... Does anybody know how to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the MQX SPI example and have modified it to communicate with the LT chip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Aug 2014 17:23:12 GMT</pubDate>
    <dc:creator>edsonsanchez</dc:creator>
    <dc:date>2014-08-20T17:23:12Z</dc:date>
    <item>
      <title>MOSI stays high after data transfer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MOSI-stays-high-after-data-transfer/m-p/371565#M12265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the k40 and I am trying to communicate with another chip from Linear Technology. I am looking at the SPI signals coming out of the k40 and I notice that the MOSI pin stays high after the data has been sent out. I want it to remain low after data transmission... Does anybody know how to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the MQX SPI example and have modified it to communicate with the LT chip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 17:23:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MOSI-stays-high-after-data-transfer/m-p/371565#M12265</guid>
      <dc:creator>edsonsanchez</dc:creator>
      <dc:date>2014-08-20T17:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: MOSI stays high after data transfer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MOSI-stays-high-after-data-transfer/m-p/371566#M12266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am not sure why you want such thing, but unfortunately this cannot be solved by any SPI configuration. SOUT signal always return to high logic in idle state.&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;option: you can invert whole output signal by external inverter (like 74HC14). However I suppose that, you don’t want take care on inverting values on master or slave side.&lt;/LI&gt;&lt;LI&gt;option: you can switch pin multiplex to GPIO during time when SOUT is inactive.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Best way how to do is create Chip select function which will be called at begin and at end of transfer.&lt;/P&gt;&lt;P&gt;For example (TWR-K40D100M, SPI0, I configured SOUT pin to input with pulldown):&lt;/P&gt;&lt;P&gt;#define BSP_SPI_MEMORY_SPI_CS&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;_mqx_int set_CS (uint32_t cs_mask, void *user_data)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_MemMapPtr&amp;nbsp; pctl;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pctl = (PORT_MemMapPtr)PORTD_BASE_PTR;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pctl-&amp;gt;PCR[2] |= PORT_PCR_PE_MASK; /* enable pull-up/down*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (cs_mask &amp;amp; BSP_SPI_MEMORY_SPI_CS)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;pctl-&amp;gt;PCR[2] = PORT_PCR_MUX(2)|PORT_PCR_PE_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* DSPI0.SOUT&amp;nbsp; */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;pctl-&amp;gt;PCR[2] = PORT_PCR_MUX(1)|PORT_PCR_PE_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* DSPI0.SOUT as GPIO */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return MQX_OK;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside task:&lt;/P&gt;&lt;P&gt;spifd = fopen (TEST_CHANNEL, NULL);&lt;/P&gt;&lt;P&gt;callback.CALLBACK = set_CS;&lt;/P&gt;&lt;P&gt;if (SPI_OK == ioctl (spifd, IO_IOCTL_SPI_SET_CS_CALLBACK, &amp;amp;callback))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf ("Setting CS callback ...OK\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;…write to SPI&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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>Fri, 22 Aug 2014 12:45:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MOSI-stays-high-after-data-transfer/m-p/371566#M12266</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2014-08-22T12:45:01Z</dc:date>
    </item>
  </channel>
</rss>

