<?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>LPC Microcontrollers中的主题 Re: SSEL as Gpio for SSP/SPI</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/SSEL-as-Gpio-for-SSP-SPI/m-p/576563#M19464</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a solution and now manual gpio manipulation of SSEL works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set up a gpio pin (it doesn't matter if it is the same pin used like SSEL function or any other gpio).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my case (SSP1 interface) pin 1.5 function 5 is SSP1 SSEL. I changed it to function 0 which is gpio.&lt;/P&gt;&lt;P&gt;Chip_SCU_PinMuxSet(0x1, 5, (SCU_PINIO_FAST | SCU_MODE_FUNC0));&amp;nbsp; /* P1.5 =&amp;gt; SSEL1 */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that i set up direction of pin to be output pin and set it high as default.&lt;/P&gt;&lt;P&gt;Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0x1, 8);&amp;nbsp; (pin P1_5 refers to gpio 1[8] according to datasheet)&lt;BR /&gt;Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0x1, 8, true);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now every time i want to toggle ssel so that i can set it low before i send spi frames and set it true after sending I&lt;/P&gt;&lt;P&gt;made pin state false, i sent frame and then waited until the spi bus is not busy (using the BSY bit from _SSP_STATUS enum struct found in ssp_18xx_43xx.h)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0x1, 8, false); &lt;BR /&gt;Chip_SSP_RWFrames_Blocking(LPC_SSP, &amp;amp;xf_setup); (as used in the peripheral_spi example of LPCOpen)&lt;/P&gt;&lt;P&gt;&amp;nbsp;if (Chip_SSP_GetStatus(LPC_SSP, SSP_STAT_BSY)) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (Chip_SSP_GetStatus(LPC_SSP, SSP_STAT_BSY)) {}&lt;BR /&gt;}&lt;BR /&gt;Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0x1, 8, true);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So SSEL gets low before i send sth and high after i send it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Sep 2016 09:36:56 GMT</pubDate>
    <dc:creator>dimitrissideris</dc:creator>
    <dc:date>2016-09-06T09:36:56Z</dc:date>
    <item>
      <title>SSEL as Gpio for SSP/SPI</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SSEL-as-Gpio-for-SSP-SPI/m-p/576562#M19463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This post came of as a sequel of this post: &lt;A _jive_internal="true" class="link-titled" href="https://community.nxp.com/thread/433004?commentID=827234&amp;amp;et=watches.email.thread#comment" title="https://community.nxp.com/message/827234?commentID=827234&amp;amp;et=watches.email.thread#comment-827234"&gt;https://community.nxp.com/message/827234?commentID=827234&amp;amp;et=watches.email.thread#comment-827234&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ll try to explain what i am trying to do and i need the manual gpio configuration.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to connect through spi an lpcxpresso4367 dev board with an esp8266 dev board. The main goal is to make a pcb with these two chips on board.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the SSP1 controller from the side of LPC. The side of esp waits a format of 8 bits command + 8 bits address + 256 bits data.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As i figured out the automatic SSEL mechanism of SSP in LPC toggles thes SSEL between high and low between each 8 bit data tha is sent through SSP which is not my case.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i needed a manual manipulation of SSEL and thats why i wanted to handle it as gpio, so that i can set it high and low each time i want to.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I connected the LPC to an oscilloscope and found out that clock works nice (clock works each time i m tyring to send sth not permanently).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MOSI and SSEL line (configured as gpio) are not behaving correctly.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see MOSI data when SSEL is high and other weird things.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to "wrap" send frame commands inside an setlow and sethigh SSEL.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found out that not any time i use sendframe function the frame is sent and now i am tyring to understand the fifo mechanism when it is ready to send a frame and so on.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now that you know what the big picture of my problem is can y give me any suggestion or help??&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2016 07:12:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SSEL-as-Gpio-for-SSP-SPI/m-p/576562#M19463</guid>
      <dc:creator>dimitrissideris</dc:creator>
      <dc:date>2016-08-31T07:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: SSEL as Gpio for SSP/SPI</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SSEL-as-Gpio-for-SSP-SPI/m-p/576563#M19464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a solution and now manual gpio manipulation of SSEL works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set up a gpio pin (it doesn't matter if it is the same pin used like SSEL function or any other gpio).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my case (SSP1 interface) pin 1.5 function 5 is SSP1 SSEL. I changed it to function 0 which is gpio.&lt;/P&gt;&lt;P&gt;Chip_SCU_PinMuxSet(0x1, 5, (SCU_PINIO_FAST | SCU_MODE_FUNC0));&amp;nbsp; /* P1.5 =&amp;gt; SSEL1 */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that i set up direction of pin to be output pin and set it high as default.&lt;/P&gt;&lt;P&gt;Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0x1, 8);&amp;nbsp; (pin P1_5 refers to gpio 1[8] according to datasheet)&lt;BR /&gt;Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0x1, 8, true);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now every time i want to toggle ssel so that i can set it low before i send spi frames and set it true after sending I&lt;/P&gt;&lt;P&gt;made pin state false, i sent frame and then waited until the spi bus is not busy (using the BSY bit from _SSP_STATUS enum struct found in ssp_18xx_43xx.h)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0x1, 8, false); &lt;BR /&gt;Chip_SSP_RWFrames_Blocking(LPC_SSP, &amp;amp;xf_setup); (as used in the peripheral_spi example of LPCOpen)&lt;/P&gt;&lt;P&gt;&amp;nbsp;if (Chip_SSP_GetStatus(LPC_SSP, SSP_STAT_BSY)) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (Chip_SSP_GetStatus(LPC_SSP, SSP_STAT_BSY)) {}&lt;BR /&gt;}&lt;BR /&gt;Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0x1, 8, true);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So SSEL gets low before i send sth and high after i send it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2016 09:36:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SSEL-as-Gpio-for-SSP-SPI/m-p/576563#M19464</guid>
      <dc:creator>dimitrissideris</dc:creator>
      <dc:date>2016-09-06T09:36:56Z</dc:date>
    </item>
  </channel>
</rss>

