<?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 LPC55S69 (OKDO-E1 Board) SPI first CLK cycle twice long in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-OKDO-E1-Board-SPI-first-CLK-cycle-twice-long/m-p/1797837#M55276</link>
    <description>&lt;P&gt;Hi, trying to understand SPI on LPC55s69&lt;BR /&gt;Sent (0b10000000) over SPI MOSI to understand how it work, find out that first CLK cycle duty is twice as long as other.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody explain to my why and how can I fix that?&lt;BR /&gt;(Need identical time cycle to control addressed led)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="analyze.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/260832iA3695A18E6AF1236/image-size/medium?v=v2&amp;amp;px=400" role="button" title="analyze.png" alt="analyze.png" /&gt;&lt;/span&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="set.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/260834i893A86953EC808EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="set.png" alt="set.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#include &amp;lt;stdio.h&amp;gt;
#include "board.h"
#include "peripherals.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "LPC55S69_cm33_core0.h"
#include "fsl_debug_console.h"

#define TRANSFER_SIZE (1) /*! Transfer dataSize */

uint8_t masterRxData[TRANSFER_SIZE] = {0};
uint8_t masterTxData[TRANSFER_SIZE] = {0};

int main(void)
{
	spi_transfer_t masterXfer;

	/* Init board hardware. */
	BOARD_InitBootPins();
	BOARD_InitBootClocks();
	BOARD_InitBootPeripherals();

	#ifndef BOARD_INIT_DEBUG_CONSOLE_PERIPHERAL
		/* Init FSL debug console. */
		BOARD_InitDebugConsole();
	#endif

	/*Config transfer*/
	masterXfer.txData = masterTxData;
	masterXfer.rxData = masterRxData;
	masterXfer.dataSize = sizeof(masterTxData);
	//masterXfer.configFlags = kSPI_FrameAssert;
	masterXfer.configFlags = 0;

	PRINTF("Debug start \r\n");

	masterTxData[0] = 0b10000000;

	while(1)
	{
		SPI_MasterTransferBlocking(FLEXCOMM8_PERIPHERAL, &amp;amp;masterXfer);
		for(volatile int i=0;i&amp;lt;500000;i++);
	}

	return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jan 2024 14:36:58 GMT</pubDate>
    <dc:creator>maciek21</dc:creator>
    <dc:date>2024-01-30T14:36:58Z</dc:date>
    <item>
      <title>LPC55S69 (OKDO-E1 Board) SPI first CLK cycle twice long</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-OKDO-E1-Board-SPI-first-CLK-cycle-twice-long/m-p/1797837#M55276</link>
      <description>&lt;P&gt;Hi, trying to understand SPI on LPC55s69&lt;BR /&gt;Sent (0b10000000) over SPI MOSI to understand how it work, find out that first CLK cycle duty is twice as long as other.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody explain to my why and how can I fix that?&lt;BR /&gt;(Need identical time cycle to control addressed led)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="analyze.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/260832iA3695A18E6AF1236/image-size/medium?v=v2&amp;amp;px=400" role="button" title="analyze.png" alt="analyze.png" /&gt;&lt;/span&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="set.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/260834i893A86953EC808EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="set.png" alt="set.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#include &amp;lt;stdio.h&amp;gt;
#include "board.h"
#include "peripherals.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "LPC55S69_cm33_core0.h"
#include "fsl_debug_console.h"

#define TRANSFER_SIZE (1) /*! Transfer dataSize */

uint8_t masterRxData[TRANSFER_SIZE] = {0};
uint8_t masterTxData[TRANSFER_SIZE] = {0};

int main(void)
{
	spi_transfer_t masterXfer;

	/* Init board hardware. */
	BOARD_InitBootPins();
	BOARD_InitBootClocks();
	BOARD_InitBootPeripherals();

	#ifndef BOARD_INIT_DEBUG_CONSOLE_PERIPHERAL
		/* Init FSL debug console. */
		BOARD_InitDebugConsole();
	#endif

	/*Config transfer*/
	masterXfer.txData = masterTxData;
	masterXfer.rxData = masterRxData;
	masterXfer.dataSize = sizeof(masterTxData);
	//masterXfer.configFlags = kSPI_FrameAssert;
	masterXfer.configFlags = 0;

	PRINTF("Debug start \r\n");

	masterTxData[0] = 0b10000000;

	while(1)
	{
		SPI_MasterTransferBlocking(FLEXCOMM8_PERIPHERAL, &amp;amp;masterXfer);
		for(volatile int i=0;i&amp;lt;500000;i++);
	}

	return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 14:36:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-OKDO-E1-Board-SPI-first-CLK-cycle-twice-long/m-p/1797837#M55276</guid>
      <dc:creator>maciek21</dc:creator>
      <dc:date>2024-01-30T14:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 (OKDO-E1 Board) SPI first CLK cycle twice long</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-OKDO-E1-Board-SPI-first-CLK-cycle-twice-long/m-p/1799761#M55305</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197102"&gt;@maciek21&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For the first picture, it seems that the clock signal is incorrect, could you please show me all the signals of SPI?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; How did you set up CPOL and CPHA? The picture is blurry and I can't see it clearly.&lt;/P&gt;
&lt;P&gt;Best regards, Alex&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 09:37:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-OKDO-E1-Board-SPI-first-CLK-cycle-twice-long/m-p/1799761#M55305</guid>
      <dc:creator>Alex_Wang</dc:creator>
      <dc:date>2024-02-01T09:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 (OKDO-E1 Board) SPI first CLK cycle twice long</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-OKDO-E1-Board-SPI-first-CLK-cycle-twice-long/m-p/1800272#M55311</link>
      <description>&lt;P&gt;hi, hope this time attache file will work&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;CPOL = 0&lt;BR /&gt;CPHA = 0&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 20:53:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-OKDO-E1-Board-SPI-first-CLK-cycle-twice-long/m-p/1800272#M55311</guid>
      <dc:creator>maciek21</dc:creator>
      <dc:date>2024-02-01T20:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 (OKDO-E1 Board) SPI first CLK cycle twice long</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-OKDO-E1-Board-SPI-first-CLK-cycle-twice-long/m-p/1800369#M55313</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197102"&gt;@maciek21&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;According to CPOL=0, the idle level is low, and CPHA=0 is rising edge sampling. While your logic analyzer shows falling edge sampling, you should choose the appropriate trigger edge. You can send me the screenshots of all SPI signals, including CLK, CS, MOSI and MISO.&lt;/P&gt;
&lt;P&gt;Best regards, Alex&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 01:28:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-OKDO-E1-Board-SPI-first-CLK-cycle-twice-long/m-p/1800369#M55313</guid>
      <dc:creator>Alex_Wang</dc:creator>
      <dc:date>2024-02-02T01:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 (OKDO-E1 Board) SPI first CLK cycle twice long</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-OKDO-E1-Board-SPI-first-CLK-cycle-twice-long/m-p/1800888#M55329</link>
      <description>&lt;P&gt;Hi, first, thanks for your help.&lt;BR /&gt;&lt;BR /&gt;That's suggestion about CPOL and CPHA kind of answer my question and helped me find solution and fix problem.&lt;/P&gt;&lt;P&gt;The IDLE state for MOSI (and all other SPI signals) in this board is HIGH, as it is physically pulled-up to VCC by a resistor.&lt;/P&gt;&lt;P&gt;Due to this information, I should use CPOL = 1 and CPHA = 1 and that's worked.&lt;/P&gt;&lt;P&gt;I believe further investigation MISO, SSEL or SCK won't be necessary because I only need MOSI to control over led.&lt;BR /&gt;&lt;BR /&gt;Have a good day&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 13:57:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-OKDO-E1-Board-SPI-first-CLK-cycle-twice-long/m-p/1800888#M55329</guid>
      <dc:creator>maciek21</dc:creator>
      <dc:date>2024-02-02T13:57:42Z</dc:date>
    </item>
  </channel>
</rss>

