<?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: SPI Slave</title>
    <link>https://community.nxp.com/t5/S32K/SPI-Slave/m-p/666622#M667</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. &lt;/P&gt;&lt;P&gt;I'm sorry for late response.&lt;/P&gt;&lt;P&gt;Thank you for your attention.&lt;/P&gt;&lt;P&gt;I resolved above problem using digital input interrupt.&lt;/P&gt;&lt;P&gt;By the way, am I right?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="14.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/26423iBF86546C3170ABFC/image-size/large?v=v2&amp;amp;px=999" role="button" title="14.jpg" alt="14.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Kim.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Jul 2017 09:19:02 GMT</pubDate>
    <dc:creator>kimjunghyun</dc:creator>
    <dc:date>2017-07-10T09:19:02Z</dc:date>
    <item>
      <title>SPI Slave</title>
      <link>https://community.nxp.com/t5/S32K/SPI-Slave/m-p/666620#M665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I have been made SPI slave activation but I have a problem.&lt;/P&gt;&lt;P&gt;I hope somebody helps me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Master : S32K144 (64pin)&lt;/P&gt;&lt;P&gt;Slave : S32K144 (64pin)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="3.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/26138i8E96F427810EC398/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.jpg" alt="3.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem : &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- In case&amp;nbsp;Master's PCS polarity and Slave's PCS polarity are 'Active low', Slave does not transfer. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Only in case&amp;nbsp;both PCS polarity are 'Active high', Slave&amp;nbsp;transfers correctly&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Configuration]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Master : &amp;nbsp;PCS polarity&amp;nbsp;is Active low&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/25863i6DD4A09EF3F8E2CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.jpg" alt="1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Slave : PCS polarity&amp;nbsp;is Active low&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/25806i65E8077C78291CE1/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.jpg" alt="2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Picture]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- PCS polarity is Active low(yellow)&amp;nbsp;and Slave does not transfer(pink)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="SPI구현_CS가 L일때 Slave(분홍)가 회신안함.bmp"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/25904iDC19CC98B7CF6096/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI구현_CS가 L일때 Slave(분홍)가 회신안함.bmp" alt="SPI구현_CS가 L일때 Slave(분홍)가 회신안함.bmp" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- PCB polarity is Active high(yellow) and Slave trasfers(pink)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="SPI구현_CS가 H일때만 Slave(분홍)가 회신함_CS가 L일때 Slave 회신하도록 수정 필요.bmp"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/25961iF52B30412B6E6D4F/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI구현_CS가 H일때만 Slave(분홍)가 회신함_CS가 L일때 Slave 회신하도록 수정 필요.bmp" alt="SPI구현_CS가 H일때만 Slave(분홍)가 회신함_CS가 L일때 Slave 회신하도록 수정 필요.bmp" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;[Source code]&lt;/P&gt;&lt;P&gt;&amp;nbsp; void PORTB_ISR(void) // PCS is input to PTB0 and PORTB generates interrupt&amp;nbsp;for falling edge&lt;BR /&gt;&amp;nbsp;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;LPSPI_DRV_SlaveTransfer(RECEIVE,&amp;amp;slaveDataSend,slaveDataReceive,BUFFER_SIZE);&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(void){&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;INT_SYS_EnableIRQ(PORTB_IRQn);&lt;BR /&gt;INT_SYS_InstallHandler(PORTB_IRQn, &amp;amp;PORTB_ISR, NULL);&amp;nbsp;&lt;/P&gt;&lt;P&gt;LPSPI_DRV_SlaveInit(RECEIVE,&amp;amp;ReceiveState,&amp;amp;Receive_SlaveConfig0);&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 09:56:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SPI-Slave/m-p/666620#M665</guid>
      <dc:creator>kimjunghyun</dc:creator>
      <dc:date>2017-06-20T09:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Slave</title>
      <link>https://community.nxp.com/t5/S32K/SPI-Slave/m-p/666621#M666</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;Can you attache your project on this thread?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Razvan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2017 08:29:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SPI-Slave/m-p/666621#M666</guid>
      <dc:creator>razva_tilimpea</dc:creator>
      <dc:date>2017-06-21T08:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Slave</title>
      <link>https://community.nxp.com/t5/S32K/SPI-Slave/m-p/666622#M667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. &lt;/P&gt;&lt;P&gt;I'm sorry for late response.&lt;/P&gt;&lt;P&gt;Thank you for your attention.&lt;/P&gt;&lt;P&gt;I resolved above problem using digital input interrupt.&lt;/P&gt;&lt;P&gt;By the way, am I right?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="14.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/26423iBF86546C3170ABFC/image-size/large?v=v2&amp;amp;px=999" role="button" title="14.jpg" alt="14.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Kim.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2017 09:19:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SPI-Slave/m-p/666622#M667</guid>
      <dc:creator>kimjunghyun</dc:creator>
      <dc:date>2017-07-10T09:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Slave</title>
      <link>https://community.nxp.com/t5/S32K/SPI-Slave/m-p/666623#M668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not 100% sure that your approach is recommended because CS is managed by lpspi hardware.&lt;/P&gt;&lt;P&gt;When you want to use SPI in slave mode you can't avoid that interrupt. You can take a look at the LPSPI example.&lt;/P&gt;&lt;P&gt;The main idea is to configure the slave transfer before the moment when the master will request data.&lt;/P&gt;&lt;P&gt;Other hint is that you can use the end transfer callback to prepare the next transfer. (It is available on EAR 0.8.4)&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;int main(void){&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;...&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;INT_SYS_EnableIRQ(PORTB_IRQn);&lt;BR /&gt;INT_SYS_InstallHandler(PORTB_IRQn, &amp;amp;PORTB_ISR, NULL);&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;LPSPI_DRV_SlaveInit(RECEIVE,&amp;amp;ReceiveState,&amp;amp;Receive_SlaveConfig0);&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;LPSPI_DRV_SlaveTransfer......&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;/* Now the master can request the data from slave.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;...&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2017 11:16:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SPI-Slave/m-p/666623#M668</guid>
      <dc:creator>razva_tilimpea</dc:creator>
      <dc:date>2017-07-10T11:16:23Z</dc:date>
    </item>
  </channel>
</rss>

