<?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 How to use SSEL1 instead of SSEL0 in SPI8 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-SSEL1-instead-of-SSEL0-in-SPI8/m-p/2048614#M57727</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with LPC55S69 development board and try to use its SPI interface to control a device.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used FLEXCOMM 8 for this application. And it works fine with ssel0, it's pulled down correctly during the conmmunication.&lt;/P&gt;&lt;P&gt;ThenI was trying to switch to use ssel1 instead of 0 since my next step is driving 3 devices, and it failed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't use Peripherals in the config tool, since it's not used in the SPI examples provided by the SDK.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I have tried:&lt;/P&gt;&lt;P&gt;1. changed&amp;nbsp;&lt;SPAN&gt;sselNum in fsl_spi.c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. added&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;void SPI3_setSSEL(uint8_t slave) {
    SPI3_InterruptDriverState.handle-&amp;gt;masterHandle.sselNum = slave;
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;in fsl_spi_cmsis.c and call it before calling the transfer. I haved changed SPI3 to SPI8.&lt;BR /&gt;This method was mentioned in&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN class=""&gt;SPI: slave select using SDK, e.g., SPI_MasterTransferNonBlocking()?&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&lt;SPAN&gt;3. modified spi8_transfer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;static int32_t SPI8_InterruptTransfer(const void *data_out, void *data_in, uint32_t num, uint8_t slave) { &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;return SPI_InterruptTransfer(data_out, data_in, num, &amp;amp;SPI8_InterruptDriverState); SPI8_InterruptDriverState.handle-&amp;gt;masterHandle.sselNum = slave; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;All above 3 didn't work. It's still SSEL0 that was pulled down during the transfering.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm a bignner. And I saw somewhere that to control mutiple device, "Manual Control of CS Lines via GPIO&amp;nbsp;" would work. But it's so confusing that the ssel1-3 was there and I could not use them.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm working on the method using GPIO for now, but still want to figure out what the problem with my code that I cannot just switch to SSEL1 from SSEL0 to control only one device. The examples and the documents were not very helpful for me. If you have any working examples, that would be very helpful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Feb 2025 23:55:35 GMT</pubDate>
    <dc:creator>waliwalabo</dc:creator>
    <dc:date>2025-02-20T23:55:35Z</dc:date>
    <item>
      <title>How to use SSEL1 instead of SSEL0 in SPI8</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-SSEL1-instead-of-SSEL0-in-SPI8/m-p/2048614#M57727</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with LPC55S69 development board and try to use its SPI interface to control a device.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used FLEXCOMM 8 for this application. And it works fine with ssel0, it's pulled down correctly during the conmmunication.&lt;/P&gt;&lt;P&gt;ThenI was trying to switch to use ssel1 instead of 0 since my next step is driving 3 devices, and it failed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't use Peripherals in the config tool, since it's not used in the SPI examples provided by the SDK.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I have tried:&lt;/P&gt;&lt;P&gt;1. changed&amp;nbsp;&lt;SPAN&gt;sselNum in fsl_spi.c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. added&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;void SPI3_setSSEL(uint8_t slave) {
    SPI3_InterruptDriverState.handle-&amp;gt;masterHandle.sselNum = slave;
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;in fsl_spi_cmsis.c and call it before calling the transfer. I haved changed SPI3 to SPI8.&lt;BR /&gt;This method was mentioned in&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN class=""&gt;SPI: slave select using SDK, e.g., SPI_MasterTransferNonBlocking()?&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&lt;SPAN&gt;3. modified spi8_transfer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;static int32_t SPI8_InterruptTransfer(const void *data_out, void *data_in, uint32_t num, uint8_t slave) { &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;return SPI_InterruptTransfer(data_out, data_in, num, &amp;amp;SPI8_InterruptDriverState); SPI8_InterruptDriverState.handle-&amp;gt;masterHandle.sselNum = slave; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;All above 3 didn't work. It's still SSEL0 that was pulled down during the transfering.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm a bignner. And I saw somewhere that to control mutiple device, "Manual Control of CS Lines via GPIO&amp;nbsp;" would work. But it's so confusing that the ssel1-3 was there and I could not use them.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm working on the method using GPIO for now, but still want to figure out what the problem with my code that I cannot just switch to SSEL1 from SSEL0 to control only one device. The examples and the documents were not very helpful for me. If you have any working examples, that would be very helpful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 23:55:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-SSEL1-instead-of-SSEL0-in-SPI8/m-p/2048614#M57727</guid>
      <dc:creator>waliwalabo</dc:creator>
      <dc:date>2025-02-20T23:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SSEL1 instead of SSEL0 in SPI8</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-SSEL1-instead-of-SSEL0-in-SPI8/m-p/2048937#M57732</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/247125"&gt;@waliwalabo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;Please check if your code is configured as follows. There is a thread that describes the steps to configure the SPI chip select signal. However, it's not written in Chinese, so I'll briefly introduce the steps to you. You can also download the code for reference.&lt;/DIV&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;&lt;A href="https://www.nxpic.org.cn/module/forum/forum.php?mod=viewthread&amp;amp;tid=628039&amp;amp;fromuid=3253523" target="_blank"&gt;https://www.nxpic.org.cn/module/forum/forum.php?mod=viewthread&amp;amp;tid=628039&amp;amp;fromuid=3253523&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;First, enable the SSEL pins.&lt;/DIV&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1234.jpg" style="width: 668px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/325125i3A4F60D41455B7F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="1234.jpg" alt="1234.jpg" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;Then, enable the slave select register.&lt;/DIV&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;
&lt;DIV id="tinyMceEditorAlice_Yang_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN&gt;We can use the&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;SPI_MasterTransferBlocking_ssel&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;function.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;This function only adds the chip select value based on the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;SPI_MasterTransferBlocking&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function and enables the chip select bit through bitwise operations. The highlighted part shows the changes:&lt;/DIV&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="777888.jpg" style="width: 644px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/325127i20FD0E8E9128E960/image-size/large?v=v2&amp;amp;px=999" role="button" title="777888.jpg" alt="777888.jpg" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;BR&lt;/DIV&gt;
&lt;DIV class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space"&gt;Alice&lt;/DIV&gt;</description>
      <pubDate>Fri, 21 Feb 2025 09:05:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-SSEL1-instead-of-SSEL0-in-SPI8/m-p/2048937#M57732</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2025-02-21T09:05:52Z</dc:date>
    </item>
  </channel>
</rss>

