<?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: How to configure multiple chip selects in LPSPI module of S32K144?</title>
    <link>https://community.nxp.com/t5/S32K/How-to-configure-multiple-chip-selects-in-LPSPI-module-of/m-p/837945#M3318</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks... :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Dec 2018 04:48:08 GMT</pubDate>
    <dc:creator>pritampatil</dc:creator>
    <dc:date>2018-12-06T04:48:08Z</dc:date>
    <item>
      <title>How to configure multiple chip selects in LPSPI module of S32K144?</title>
      <link>https://community.nxp.com/t5/S32K/How-to-configure-multiple-chip-selects-in-LPSPI-module-of/m-p/837943#M3316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here i am able to transmit data via LPSPI1 if i have one chip select. But, the problem arises when i try to configure multiple chip select pins one after the other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached sample code where i have configured multiple chip selects in LPSPI1&lt;/P&gt;&lt;P&gt;Module: &lt;STRONG&gt;LPSPI1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;PCS pins: &lt;STRONG&gt;PTA6, PTD3, PTB17&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SCLK pin:&amp;nbsp;&lt;STRONG&gt;PTB14&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MOSI pin:&amp;nbsp;&lt;STRONG&gt;PTB16&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MISO pin: &lt;STRONG&gt;PTB15&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the following methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Change the PCS selection SFR in LPSPI initialisation function,&lt;/P&gt;&lt;P&gt;i.e.&amp;nbsp;LPSPI1-&amp;gt;TCR&amp;nbsp; &amp;nbsp;= 0x5100000F;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Configure PCS pins as GPIO and pull one pin LOW at a time and others HIGH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;please refer attached code and do the needful changes in it to make multiple slaves work.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2018 13:10:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-to-configure-multiple-chip-selects-in-LPSPI-module-of/m-p/837943#M3316</guid>
      <dc:creator>pritampatil</dc:creator>
      <dc:date>2018-12-05T13:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure multiple chip selects in LPSPI module of S32K144?</title>
      <link>https://community.nxp.com/t5/S32K/How-to-configure-multiple-chip-selects-in-LPSPI-module-of/m-p/837944#M3317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please try something like this:&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;SELECT_U2();
TRANSMIT_SPI_CMDS();
while((LPSPI1-&amp;gt;SR &amp;amp; LPSPI_SR_TCF_MASK)&amp;gt;&amp;gt;LPSPI_SR_TCF_SHIFT==0);
LPSPI1-&amp;gt;SR |= LPSPI_SR_TCF_MASK;
LPSPI1_receive_16bits();

SELECT_U3();
TRANSMIT_SPI_CMDS();
while((LPSPI1-&amp;gt;SR &amp;amp; LPSPI_SR_TCF_MASK)&amp;gt;&amp;gt;LPSPI_SR_TCF_SHIFT==0);
LPSPI1-&amp;gt;SR |= LPSPI_SR_TCF_MASK;
LPSPI1_receive_16bits();

SELECT_U7();
TRANSMIT_SPI_CMDS();
while((LPSPI1-&amp;gt;SR &amp;amp; LPSPI_SR_TCF_MASK)&amp;gt;&amp;gt;LPSPI_SR_TCF_SHIFT==0);
LPSPI1-&amp;gt;SR |= LPSPI_SR_TCF_MASK;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Otherwise the code that toggles the GPIO doesn't wait for the SPI to complete the transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2018 16:32:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-to-configure-multiple-chip-selects-in-LPSPI-module-of/m-p/837944#M3317</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2018-12-05T16:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure multiple chip selects in LPSPI module of S32K144?</title>
      <link>https://community.nxp.com/t5/S32K/How-to-configure-multiple-chip-selects-in-LPSPI-module-of/m-p/837945#M3318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks... :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2018 04:48:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-to-configure-multiple-chip-selects-in-LPSPI-module-of/m-p/837945#M3318</guid>
      <dc:creator>pritampatil</dc:creator>
      <dc:date>2018-12-06T04:48:08Z</dc:date>
    </item>
  </channel>
</rss>

