<?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>S32KのトピックRe: S32K148 LPSPI unexpected data</title>
    <link>https://community.nxp.com/t5/S32K/S32K148-LPSPI-unexpected-data/m-p/1799483#M31301</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/207633"&gt;@semiconductor_user&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;you can send data/command to slave first and expect slave to reply data in the same frame. refer to Petr's attached snapshot.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2024 04:59:08 GMT</pubDate>
    <dc:creator>joshua_hong</dc:creator>
    <dc:date>2024-02-01T04:59:08Z</dc:date>
    <item>
      <title>S32K148 LPSPI unexpected data</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-LPSPI-unexpected-data/m-p/1209756#M9546</link>
      <description>&lt;P&gt;Hi NXP Tech Community,&lt;/P&gt;&lt;P&gt;Our customer has configured the S32K148 LPSPI PCS3 to communicate with the ST accelerometer and gyroscope, ASM330LHH. They are testing this on their prototype board.&lt;/P&gt;&lt;P&gt;The S32K148 MCU is reading 2 bytes, where the first byte and second byte data are 0xFF and 0x6B respectively. The first byte 0xFF is an additional byte which the data is not expected by the customer.&lt;/P&gt;&lt;P&gt;Customer would like to know with an example, &lt;STRONG&gt;what is the correct way of reading and writing single and multiple bytes&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;Below is the snapshot of project configuration of the customer’s project.&lt;/P&gt;&lt;P&gt;&lt;U&gt;SPI configuration&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joshua_hong_0-1610379445925.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134446i225E5D597EB224AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joshua_hong_0-1610379445925.png" alt="joshua_hong_0-1610379445925.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;They are using Chip Select 3.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joshua_hong_1-1610379445951.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134444iF1F9CD1757F1D83C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joshua_hong_1-1610379445951.png" alt="joshua_hong_1-1610379445951.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The transmit and receive buffer size are 10.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joshua_hong_2-1610379445970.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134445i80DF71E23782F388/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joshua_hong_2-1610379445970.png" alt="joshua_hong_2-1610379445970.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the code is uploaded onto the MCU, it is reading 2 bytes, where the first byte and second byte data are 0xFF and 0x6B respectively. The first byte 0xFF is an additional byte which the data is not expected by the customer.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joshua_hong_3-1610379446031.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134447iE9112F3EDA3FA399/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joshua_hong_3-1610379446031.png" alt="joshua_hong_3-1610379446031.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joshua_hong_4-1610379447208.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134448i454A7DF89EB4BFDA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joshua_hong_4-1610379447208.png" alt="joshua_hong_4-1610379447208.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The oscilloscope is also seeing 0xFF 0x6B. The ST accelerometer and gyroscope address is 0x6B. but the first byte is not expected by the customer.&lt;/P&gt;&lt;P&gt;The customer’s code snippet is as below:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="1561"&gt;&lt;P&gt;acl_spi2_tx_buf[0] = 0x0FU | 0x80U;//Reading: who &lt;U&gt;iam&lt;/U&gt;&lt;/P&gt;&lt;P&gt;//acl_spi2_tx_buf[0] = 0x0FU; //| 0x01U;//Reading: who &lt;U&gt;iam&lt;/U&gt;&lt;/P&gt;&lt;P&gt;//LPSPI_DRV_MasterTransferBlocking(SPI_2,acl_spi2_tx_buf,acl_spi2_rx_buf,5,OSIF_WAIT_FOREVER);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LPSPI_DRV_MasterTransferBlocking(ACL_Slave_Inst,acl_spi2_tx_buf,acl_spi2_rx_buf,2,OSIF_WAIT_FOREVER);&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 15:40:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-LPSPI-unexpected-data/m-p/1209756#M9546</guid>
      <dc:creator>joshua_hong</dc:creator>
      <dc:date>2021-01-11T15:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: S32K148 LPSPI unexpected data</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-LPSPI-unexpected-data/m-p/1210132#M9551</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;seems the reading is correct, first 0xFF is just dummy byte SPI reads as line is held high.&lt;BR /&gt;Reading slave registers consist of sending 2 bytes from master, address and dummy.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-01-12_7-19-30.png" style="width: 558px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134500iA295DF939FCCD512/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-01-12_7-19-30.png" alt="2021-01-12_7-19-30.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And so SPI is reading also 2 bytes, dummy byte (0xFF) and and register value (0x6B).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 06:33:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-LPSPI-unexpected-data/m-p/1210132#M9551</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2021-01-12T06:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: S32K148 LPSPI unexpected data</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-LPSPI-unexpected-data/m-p/1799477#M31300</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52961"&gt;@PetrS&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/161307"&gt;@joshua_hong&lt;/a&gt;&amp;nbsp;can you tell me what we be a transmitting and receving frame, and how to read this frames. i mean should i send data to slave or just i read data from slave.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 04:40:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-LPSPI-unexpected-data/m-p/1799477#M31300</guid>
      <dc:creator>semiconductor_user</dc:creator>
      <dc:date>2024-02-01T04:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: S32K148 LPSPI unexpected data</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-LPSPI-unexpected-data/m-p/1799483#M31301</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/207633"&gt;@semiconductor_user&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;you can send data/command to slave first and expect slave to reply data in the same frame. refer to Petr's attached snapshot.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 04:59:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-LPSPI-unexpected-data/m-p/1799483#M31301</guid>
      <dc:creator>joshua_hong</dc:creator>
      <dc:date>2024-02-01T04:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: S32K148 LPSPI unexpected data</title>
      <link>https://community.nxp.com/t5/S32K/S32K148-LPSPI-unexpected-data/m-p/1799597#M31307</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52961"&gt;@PetrS&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/161307"&gt;@joshua_hong&lt;/a&gt;&amp;nbsp;if you have sample code of this communication plz send me. so that i can understand what address and data will be transmit for getting proper reading of IMU data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 07:14:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K148-LPSPI-unexpected-data/m-p/1799597#M31307</guid>
      <dc:creator>semiconductor_user</dc:creator>
      <dc:date>2024-02-01T07:14:25Z</dc:date>
    </item>
  </channel>
</rss>

