<?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: Why the CSPI slave mode receive wrong data? in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Why-the-CSPI-slave-mode-receive-wrong-data/m-p/375161#M53737</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;Jianwang,&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&amp;nbsp; Please look at the enclosed figure.&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;The SPI system can be considered of as a distributed 64-bit shift Register where half is in the master&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;BR /&gt;and half is in the slave peripheral. When a transfer takes place this shift Register is circulated 32 bit positions,&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;BR /&gt;so the data from the master ends up in the slave and the data from the slave ends up in the master ;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;BR /&gt;data is exchanged in full duplex fashion. Therefore, b&lt;/SPAN&gt;ecause of SPI nature (it may be considered as a ring, where &lt;BR /&gt;each clock provides both output bit and input one) the very first input bits of the RxFIFO may contain a garbage.&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;&amp;nbsp; Not all slave peripherals implement both data directions. In this case there is a data line from&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;BR /&gt;the peripheral to the master but none from the master to the shift Register.&amp;nbsp; When the master SPI wants to read&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;BR /&gt;this port, it initiates an SPI transfer by writing data to the SPI data Register. The slave cannot initiate transfer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;Also, please pay attention on the section 23.3.1 (Software Restrictions) of the i.MX27 Reference Manual :&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;• All reserved bits cannot be written and always read as 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;• Writes to the TXDATA register are ignored when the CSPI module is disabled (SPIEN bit of CSPI&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;&amp;nbsp; ControlReg is cleared).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;• The SPI Module Enable Control bit must be asserted before writing to other registers or initiating&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;&amp;nbsp; an exchange.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="14367_14367.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119919iAA5B9BBD550562E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="14367_14367.jpg" alt="14367_14367.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="SPI.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45191iFC866CED651ECA18/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI.jpg" alt="SPI.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Yuri&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>Tue, 26 Aug 2014 02:13:02 GMT</pubDate>
    <dc:creator>Yuri</dc:creator>
    <dc:date>2014-08-26T02:13:02Z</dc:date>
    <item>
      <title>Why the CSPI slave mode receive wrong data?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Why-the-CSPI-slave-mode-receive-wrong-data/m-p/375159#M53735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-size: 12pt; font-family: arial,helvetica,sans-serif;"&gt;Hi:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I'm developing codes to communicating by using SPI module between two i.MX27 board . &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt; One board works as the master/host CSPI and another works as the slave. I have writen master and slave code according the Freescale BSP's mxc_spi_test test code.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 12pt;"&gt; and my configuration is the following shape:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MOSI is connected to MOSI&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MISO is connected to MISO&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCK is connected to SCK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SS is connected to SS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The slave&amp;nbsp; CSPI&amp;nbsp; when to receive data w&lt;SPAN class="high-light-bg"&gt;ork as the&lt;/SPAN&gt; interrupt mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Firstly I use the loopback test to test the&amp;nbsp; CSPI. The master and slave CSPI work well, and they can write and receive same data. &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Secondly I connect two bosrd's CSPI interface. It work as :the master write some data and the slave receive its data from the master/host CSPI.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thirdly we can see receive data by HYPER TERMINAL.Sometimes the receive is OK.But sometimes the receive data is wrong.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; That is :&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;I use SPI to write/send and receive data, the result is not correct. The 0x73 (01110011): the master/host send to the slave ,the slave &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;received number is 0x37 (00110111) or 0x6E (01111110) and other data, the data is obviously 0x73 after shifting the data to the host from machine, the return value is the value after the shift, not the original value.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I test another data. The master/host send to the 11114444,the slave &lt;SPAN style="font-size: 12pt;"&gt;received 1111CCCC ,CCCC or 3CCC and other data. The 1(0011 0001), 4(0011 0100) C(0100 0011),3(0011 0011). So the received data is the value after the shift.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-size: 12pt; font-family: arial,helvetica,sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-size: 12pt; font-family: arial,helvetica,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Every test I have run the SPI slave first and run the SPI master later. So the slaver receive first and master write data to the SPI later. The slave receive correct data after the master SPI write the data to the SPI. But sometime the slave SPI become receive wrong data and after few wrong data it becaome receive the correct data.&amp;nbsp; This wrong receive can appear often when I take the test.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I donot known Why it is work incorrect? The master and slave clock polarity and phase are configured the same,the max_speed_hz = 1000000. Because I think the high speed would make CSPI work not well so I set the speed is 1000000. But I need the CSPI work as 4Mbps. The low speed are not working properly, not to mention the high speed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Follow is the HYPER TERMINAL print the message:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p0"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The master write the data is 11114444, the slave should Data receive the 11114444.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p0"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Data received : 11114444&lt;/P&gt;&lt;P&gt;Data received : 11114444&lt;/P&gt;&lt;P&gt;Data received : 11114444&lt;/P&gt;&lt;P&gt;Data received : 11114444&lt;/P&gt;&lt;P&gt;Data received : 11114444&lt;/P&gt;&lt;P&gt;Data received : 11114444&lt;/P&gt;&lt;P&gt;Data received : 11114444&lt;/P&gt;&lt;P&gt;[fwriten data to SPI]ERROR: errno = 1, strerror = Operation not permitted&lt;/P&gt;&lt;P&gt;Data received : 1111CCCC&lt;/P&gt;&lt;P&gt;Data received : CCCC&lt;/P&gt;&lt;P&gt;Data received : 3CCC&lt;/P&gt;&lt;P&gt;Data received : CCCC&lt;/P&gt;&lt;P&gt;Data received : 3CCC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 12pt;"&gt;The another test: the master send 1111444411114444,the slave should&amp;nbsp; receive 1111444411114444.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data received : 1111444411114444&lt;/P&gt;&lt;P&gt;Data received : 1111444411114444&lt;/P&gt;&lt;P&gt;Data received : 1111444414444111&lt;/P&gt;&lt;P&gt;Data received : 111144441D4441&lt;/P&gt;&lt;P&gt;Data received : 1111444411114444&lt;/P&gt;&lt;P&gt;Data received : 1111444414444111&lt;/P&gt;&lt;P&gt;Data received : 11114444111144CC&lt;/P&gt;&lt;P&gt;Data received : CCCC3CCC&lt;/P&gt;&lt;P&gt;Data received : CCCCCCCC&lt;/P&gt;&lt;P&gt;Data received : CCCCCCCC&lt;/P&gt;&lt;P class="p0"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 12pt;"&gt; Am I missing something here? &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: arial,helvetica,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Any pointers will be appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 07:47:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Why-the-CSPI-slave-mode-receive-wrong-data/m-p/375159#M53735</guid>
      <dc:creator>wason</dc:creator>
      <dc:date>2014-08-22T07:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why the CSPI slave mode receive wrong data?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Why-the-CSPI-slave-mode-receive-wrong-data/m-p/375160#M53736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Hi, &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; From the data sheet of the i.mx27&amp;nbsp; I known that if the slave want read the data from the SPI master the slave should write same number of the data to the SPI and later read the data then.So according to the i.MX27 driver I write the same number dummy data to the SPI and then read same number of data from SPI master.&amp;nbsp; Is it all right?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If anyone who can find some mistake please tell me without hesitate .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks you. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: arial,helvetica,sans-serif;"&gt;Any pointers will be appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 01:26:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Why-the-CSPI-slave-mode-receive-wrong-data/m-p/375160#M53736</guid>
      <dc:creator>wason</dc:creator>
      <dc:date>2014-08-26T01:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why the CSPI slave mode receive wrong data?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Why-the-CSPI-slave-mode-receive-wrong-data/m-p/375161#M53737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;Jianwang,&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&amp;nbsp; Please look at the enclosed figure.&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;The SPI system can be considered of as a distributed 64-bit shift Register where half is in the master&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;BR /&gt;and half is in the slave peripheral. When a transfer takes place this shift Register is circulated 32 bit positions,&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;BR /&gt;so the data from the master ends up in the slave and the data from the slave ends up in the master ;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;BR /&gt;data is exchanged in full duplex fashion. Therefore, b&lt;/SPAN&gt;ecause of SPI nature (it may be considered as a ring, where &lt;BR /&gt;each clock provides both output bit and input one) the very first input bits of the RxFIFO may contain a garbage.&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;&amp;nbsp; Not all slave peripherals implement both data directions. In this case there is a data line from&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;BR /&gt;the peripheral to the master but none from the master to the shift Register.&amp;nbsp; When the master SPI wants to read&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;BR /&gt;this port, it initiates an SPI transfer by writing data to the SPI data Register. The slave cannot initiate transfer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;Also, please pay attention on the section 23.3.1 (Software Restrictions) of the i.MX27 Reference Manual :&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;• All reserved bits cannot be written and always read as 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;• Writes to the TXDATA register are ignored when the CSPI module is disabled (SPIEN bit of CSPI&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;&amp;nbsp; ControlReg is cleared).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;• The SPI Module Enable Control bit must be asserted before writing to other registers or initiating&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;&amp;nbsp; an exchange.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: normal; font-style: normal; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13px; font-family: Verdana, sans-serif;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="14367_14367.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119919iAA5B9BBD550562E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="14367_14367.jpg" alt="14367_14367.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="SPI.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45191iFC866CED651ECA18/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI.jpg" alt="SPI.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Yuri&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>Tue, 26 Aug 2014 02:13:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Why-the-CSPI-slave-mode-receive-wrong-data/m-p/375161#M53737</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2014-08-26T02:13:02Z</dc:date>
    </item>
  </channel>
</rss>

