<?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 TJK1145 module read device number error in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/TJK1145-module-read-device-number-error/m-p/852894#M4258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I recently debugged the TJK1145 module and used the spi interface to read the device ID. The data read is the same as the data written. Is there a problem with my driver? The comment in the code is the interface function written by the register. This function is no problem. The following is what I wrote with the sdk interface function. Is this correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u8 TJA1145_WriteByte(u8 u8Data)&lt;BR /&gt;{&lt;BR /&gt;#if 0&lt;BR /&gt; u8 u8DataReadBack;&lt;BR /&gt; DSPI_0.PUSHR.PUSHR.R = (u32)((u32)u8Data + 0x08010000);&lt;BR /&gt; //DSPI_0.PUSHR.PUSHR.B.PCS = 0;&lt;BR /&gt; while (DSPI_0.SR.B.TCF != 1){}&lt;/P&gt;&lt;P&gt;DSPI_0.SR.B.TCF = 1;&lt;/P&gt;&lt;P&gt;while (DSPI_0.SR.B.RFDF != 1){}&lt;BR /&gt; u8DataReadBack = (u8)DSPI_0.POPR.R;&lt;BR /&gt; DSPI_0.SR.R = 0xFCFE0000; /* Clear ALL status flags by writing 1 to them */&lt;BR /&gt; return u8DataReadBack;&lt;BR /&gt;#endif&lt;BR /&gt; uint8_t receive_data[4] = {0x0};&lt;BR /&gt; uint8_t send_buff[4] = {u8Data, 0X00, 0x00, 0x00};&lt;BR /&gt;&lt;SPAN&gt;uint8_t&amp;nbsp;&lt;/SPAN&gt; i = 0;&lt;BR /&gt; send_buff[0] = u8Data;&lt;BR /&gt; for(i = 0; i &amp;lt; 3; i++)&lt;BR /&gt; {&lt;BR /&gt; send_buff[3 - i] = (uint8_t)((0x08010000 &amp;amp; (0x0000FF &amp;lt;&amp;lt; (8 * i))) &amp;gt;&amp;gt; (8 * i));&lt;BR /&gt; }&lt;BR /&gt; LPSPI_DRV_MasterTransferBlocking(LPSPICOM1, send_buff, receive_data, 4, 100UL);&lt;BR /&gt; return receive_data[0];&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Mar 2019 03:12:19 GMT</pubDate>
    <dc:creator>gm2010ustc</dc:creator>
    <dc:date>2019-03-13T03:12:19Z</dc:date>
    <item>
      <title>TJK1145 module read device number error</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/TJK1145-module-read-device-number-error/m-p/852894#M4258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I recently debugged the TJK1145 module and used the spi interface to read the device ID. The data read is the same as the data written. Is there a problem with my driver? The comment in the code is the interface function written by the register. This function is no problem. The following is what I wrote with the sdk interface function. Is this correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u8 TJA1145_WriteByte(u8 u8Data)&lt;BR /&gt;{&lt;BR /&gt;#if 0&lt;BR /&gt; u8 u8DataReadBack;&lt;BR /&gt; DSPI_0.PUSHR.PUSHR.R = (u32)((u32)u8Data + 0x08010000);&lt;BR /&gt; //DSPI_0.PUSHR.PUSHR.B.PCS = 0;&lt;BR /&gt; while (DSPI_0.SR.B.TCF != 1){}&lt;/P&gt;&lt;P&gt;DSPI_0.SR.B.TCF = 1;&lt;/P&gt;&lt;P&gt;while (DSPI_0.SR.B.RFDF != 1){}&lt;BR /&gt; u8DataReadBack = (u8)DSPI_0.POPR.R;&lt;BR /&gt; DSPI_0.SR.R = 0xFCFE0000; /* Clear ALL status flags by writing 1 to them */&lt;BR /&gt; return u8DataReadBack;&lt;BR /&gt;#endif&lt;BR /&gt; uint8_t receive_data[4] = {0x0};&lt;BR /&gt; uint8_t send_buff[4] = {u8Data, 0X00, 0x00, 0x00};&lt;BR /&gt;&lt;SPAN&gt;uint8_t&amp;nbsp;&lt;/SPAN&gt; i = 0;&lt;BR /&gt; send_buff[0] = u8Data;&lt;BR /&gt; for(i = 0; i &amp;lt; 3; i++)&lt;BR /&gt; {&lt;BR /&gt; send_buff[3 - i] = (uint8_t)((0x08010000 &amp;amp; (0x0000FF &amp;lt;&amp;lt; (8 * i))) &amp;gt;&amp;gt; (8 * i));&lt;BR /&gt; }&lt;BR /&gt; LPSPI_DRV_MasterTransferBlocking(LPSPICOM1, send_buff, receive_data, 4, 100UL);&lt;BR /&gt; return receive_data[0];&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Mar 2019 03:12:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/TJK1145-module-read-device-number-error/m-p/852894#M4258</guid>
      <dc:creator>gm2010ustc</dc:creator>
      <dc:date>2019-03-13T03:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: TJK1145 module read device number error</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/TJK1145-module-read-device-number-error/m-p/852895#M4259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is your EVB? It seems that you are using SDK, in this case there is no reason to use registers directly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jiri&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Mar 2019 08:28:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/TJK1145-module-read-device-number-error/m-p/852895#M4259</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2019-03-13T08:28:11Z</dc:date>
    </item>
  </channel>
</rss>

