<?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 Re: SPI with several chip selects in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372769#M761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Ole&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) At the begin of the project , it need initialize both SPI0 and SPI1,&lt;/P&gt;&lt;P&gt;complete the two component&amp;nbsp; basic SPI configure.&lt;/P&gt;&lt;P&gt;And&amp;nbsp;&amp;nbsp; delete "&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Start the transfer process in the hardware */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DSPI_HAL_StartTransfer(baseAddr);&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;(2)&amp;nbsp; n the process of replacement , use the function&amp;nbsp;&amp;nbsp; "DSPI_HAL_StartTransfer()"&amp;nbsp; and "DSPI_HAL_StopTransfer()".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(3) About the bit PCS[x] you said , both PCS[0] and PCS[1] (if use SPI0 and SPI1 ) already set "Assert"&amp;nbsp; in the initialize function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(4) Of course ,&amp;nbsp; if there have public register the two SPI&amp;nbsp; both use ,and only can select one SPI in this register ,&amp;nbsp; it need reconfigure in the change period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Jan 2015 08:24:21 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2015-01-26T08:24:21Z</dc:date>
    <item>
      <title>SPI with several chip selects</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372766#M758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am using KSDK 1.1.0 on a FRDM-K64 board and would like to use an SPI port with multiple chip selects (multiple connected slaves). I used Processor Expert to set up the DSPI peripheral with two different master configurations that have their dedicated chip select pin.&lt;/P&gt;&lt;P&gt;My question is: How can I change between using the two chip selects? I would like to avoid to reinitialize the whole driver by using DSPI_DRV_Master(De)Init() each time. Is there any simple way to switch between several chip selects?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Matthias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2015 14:07:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372766#M758</guid>
      <dc:creator>matthias</dc:creator>
      <dc:date>2015-01-23T14:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: SPI with several chip selects</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372767#M759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi matthias ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use "DSPI_HAL_StartTransfer()"&amp;nbsp; and "DSPI_HAL_StopTransfer()" change between using the two chip selects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Alice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2015 02:12:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372767#M759</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-01-26T02:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: SPI with several chip selects</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372768#M760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure? According to the comment in peripeherals_init.c:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*!&lt;/P&gt;&lt;P&gt; * @brief Starts the DSPI transfers, clears HALT bit in MCR.&lt;/P&gt;&lt;P&gt; *&lt;/P&gt;&lt;P&gt; * This function call called whenever the module is ready to begin data transfers in either master&lt;/P&gt;&lt;P&gt; * or slave mode.&lt;/P&gt;&lt;P&gt; *&lt;/P&gt;&lt;P&gt; * @param baseAddr Module base address&lt;/P&gt;&lt;P&gt; */&lt;/P&gt;&lt;P&gt;static inline void DSPI_HAL_StartTransfer(uint32_t baseAddr)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BW_SPI_MCR_HALT(baseAddr, 0);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does this sw change the PCS bits in the SPIx_PUSHR register?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2015 07:30:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372768#M760</guid>
      <dc:creator>oaf</dc:creator>
      <dc:date>2015-01-26T07:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: SPI with several chip selects</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372769#M761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Ole&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) At the begin of the project , it need initialize both SPI0 and SPI1,&lt;/P&gt;&lt;P&gt;complete the two component&amp;nbsp; basic SPI configure.&lt;/P&gt;&lt;P&gt;And&amp;nbsp;&amp;nbsp; delete "&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Start the transfer process in the hardware */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DSPI_HAL_StartTransfer(baseAddr);&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;(2)&amp;nbsp; n the process of replacement , use the function&amp;nbsp;&amp;nbsp; "DSPI_HAL_StartTransfer()"&amp;nbsp; and "DSPI_HAL_StopTransfer()".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(3) About the bit PCS[x] you said , both PCS[0] and PCS[1] (if use SPI0 and SPI1 ) already set "Assert"&amp;nbsp; in the initialize function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(4) Of course ,&amp;nbsp; if there have public register the two SPI&amp;nbsp; both use ,and only can select one SPI in this register ,&amp;nbsp; it need reconfigure in the change period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2015 08:24:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372769#M761</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-01-26T08:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: SPI with several chip selects</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372770#M762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alice,&lt;/P&gt;&lt;P&gt;thanks for your reply. I think there is a misunderstanding. I do not want to use two different SPI ports. As said, I have two slaves connected to the &lt;SPAN style="text-decoration: underline;"&gt;same&lt;/SPAN&gt; SPI port (in my case SPI0) and I want to change the chip select that is used when transferring data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I figured out that the PCS bits in the SPI0_PUSHR register should be changed as Ole said. To achieve this, I change the component &lt;EM&gt;whichPcs&lt;/EM&gt; in the structure g_dspiStatePtr[FSL_SPICOM0] that is used globally in fsl_dspi_master_driver.c. Like this, the correct PCS bits are set when calling&amp;nbsp; DSPI_DRV_MasterTransferBlocking(), for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this the right way to do it or are there any functions in the KSDK driver that should be used?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Matthias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2015 09:21:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372770#M762</guid>
      <dc:creator>matthias</dc:creator>
      <dc:date>2015-01-26T09:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: SPI with several chip selects</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372771#M763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi mattias,&lt;/P&gt;&lt;P&gt;I know your meaning .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the KSDK, there is not the driver function to change slave spi.&lt;/P&gt;&lt;P&gt;I recommend you configure the pcs pin&amp;nbsp; to&amp;nbsp; GPIO pin,&amp;nbsp; when want to select the slave spi, set the related pin to 0, the other on to 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2015 12:10:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/SPI-with-several-chip-selects/m-p/372771#M763</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-01-26T12:10:00Z</dc:date>
    </item>
  </channel>
</rss>

