<?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 SPI Read Data Problem in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Data-Problem/m-p/968104#M144167</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi hope you all are doing good.&amp;nbsp; i'm already done with spidev_test and thats working well, i can send and receive the data. but the problem is when i read the data from arduino uno r3 or Lora (SPI interface module). all receive data is currupted or damaged. i don't know whats going on is it hardware problem or a coding problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please share your experience.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;here is the Pyhton code:&lt;/P&gt;&lt;P&gt;===========================================&lt;/P&gt;&lt;P&gt;import spidev&lt;BR /&gt;import time&lt;BR /&gt;spi = spidev.SpiDev()&lt;BR /&gt;spi.open(0, 0)&lt;BR /&gt;spi.max_speed_hz = 500000&lt;BR /&gt;spi.mode = 0b11&lt;BR /&gt;try:&lt;BR /&gt; while True:&lt;/P&gt;&lt;P&gt;resp = spi.readbytes(3) #spi.xfer([0xAA])#readbytes(3)&lt;BR /&gt; if (resp[0] != 255):&lt;BR /&gt; #print(''.join(["0x%02X " % x for x in resp]).strip())&lt;BR /&gt; value = resp[1] + resp[2]&lt;BR /&gt; print(value)&lt;BR /&gt; byte1 = bin(resp[0])[2:].rjust(8,'0')&lt;BR /&gt; byte2 = bin(resp[1])[2:].rjust(8,'0')&lt;BR /&gt; byte3 = bin(resp[2])[2:].rjust(8,'0')&lt;BR /&gt; bits = byte1 + byte2 + byte3&lt;BR /&gt; print(bits)&lt;BR /&gt; time.sleep(0.05)&lt;BR /&gt;except KeyboardInterrupt:&lt;BR /&gt; spi.close()&lt;/P&gt;&lt;P&gt;========================================================&lt;/P&gt;&lt;P&gt;OUTPUT :&lt;BR /&gt;510&lt;BR /&gt;111111011111111111111111&lt;BR /&gt;=========================================================================&lt;/P&gt;&lt;P&gt;and if i use linux spidev_test to read data from arduino i get&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FF FF FF 7F FF FF FD FF &lt;BR /&gt;FF FF 7F FF FF FE FF FF &lt;BR /&gt;FF DF FF FF FF FF FF FF &lt;BR /&gt;CF FF FF FF FF FF FF FB &lt;BR /&gt;FF FF FF FF FF FF&lt;BR /&gt;&lt;BR /&gt;THANKS&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Oct 2019 08:34:54 GMT</pubDate>
    <dc:creator>umershah81</dc:creator>
    <dc:date>2019-10-10T08:34:54Z</dc:date>
    <item>
      <title>SPI Read Data Problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Data-Problem/m-p/968104#M144167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi hope you all are doing good.&amp;nbsp; i'm already done with spidev_test and thats working well, i can send and receive the data. but the problem is when i read the data from arduino uno r3 or Lora (SPI interface module). all receive data is currupted or damaged. i don't know whats going on is it hardware problem or a coding problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please share your experience.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;here is the Pyhton code:&lt;/P&gt;&lt;P&gt;===========================================&lt;/P&gt;&lt;P&gt;import spidev&lt;BR /&gt;import time&lt;BR /&gt;spi = spidev.SpiDev()&lt;BR /&gt;spi.open(0, 0)&lt;BR /&gt;spi.max_speed_hz = 500000&lt;BR /&gt;spi.mode = 0b11&lt;BR /&gt;try:&lt;BR /&gt; while True:&lt;/P&gt;&lt;P&gt;resp = spi.readbytes(3) #spi.xfer([0xAA])#readbytes(3)&lt;BR /&gt; if (resp[0] != 255):&lt;BR /&gt; #print(''.join(["0x%02X " % x for x in resp]).strip())&lt;BR /&gt; value = resp[1] + resp[2]&lt;BR /&gt; print(value)&lt;BR /&gt; byte1 = bin(resp[0])[2:].rjust(8,'0')&lt;BR /&gt; byte2 = bin(resp[1])[2:].rjust(8,'0')&lt;BR /&gt; byte3 = bin(resp[2])[2:].rjust(8,'0')&lt;BR /&gt; bits = byte1 + byte2 + byte3&lt;BR /&gt; print(bits)&lt;BR /&gt; time.sleep(0.05)&lt;BR /&gt;except KeyboardInterrupt:&lt;BR /&gt; spi.close()&lt;/P&gt;&lt;P&gt;========================================================&lt;/P&gt;&lt;P&gt;OUTPUT :&lt;BR /&gt;510&lt;BR /&gt;111111011111111111111111&lt;BR /&gt;=========================================================================&lt;/P&gt;&lt;P&gt;and if i use linux spidev_test to read data from arduino i get&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FF FF FF 7F FF FF FD FF &lt;BR /&gt;FF FF 7F FF FF FE FF FF &lt;BR /&gt;FF DF FF FF FF FF FF FF &lt;BR /&gt;CF FF FF FF FF FF FF FB &lt;BR /&gt;FF FF FF FF FF FF&lt;BR /&gt;&lt;BR /&gt;THANKS&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2019 08:34:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Data-Problem/m-p/968104#M144167</guid>
      <dc:creator>umershah81</dc:creator>
      <dc:date>2019-10-10T08:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: IMX6UL IOMUXC Register</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Data-Problem/m-p/968105#M144168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Syed Bukhari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My recommendation would be using the Pins Tool for i.MX, which provides a GUI that allows you to see the available muxing options for each module and it also generates the code for the device tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can download it from the link below on the Downloads section:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nxp.com/design/designs/pins-tool-for-i.mx-application-processors:PINS-TOOL-IMX"&gt;https://www.nxp.com/design/designs/pins-tool-for-i.mx-application-processors:PINS-TOOL-IMX&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2019 17:13:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Data-Problem/m-p/968105#M144168</guid>
      <dc:creator>gusarambula</dc:creator>
      <dc:date>2019-10-10T17:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: IMX6UL IOMUXC Register</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Data-Problem/m-p/968106#M144169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;thanks brother,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Actually, i enabled spidev in kernel config manually but while compiling through bitbake it replaces the config with default.&amp;nbsp;&lt;BR /&gt;i solved it buy editing config using bitbake.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2019 08:31:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Data-Problem/m-p/968106#M144169</guid>
      <dc:creator>umershah81</dc:creator>
      <dc:date>2019-10-16T08:31:49Z</dc:date>
    </item>
  </channel>
</rss>

