<?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: 17bit or 25bit spi frame using LPC546xx family in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096984#M42042</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexis this is what I'm trying to do, but there seems to be a problem with this particular combination as if I do a 10bit transfer I get what I expect 10 bits clocked out per frame with&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#define BUFFER_SIZE (2)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;static uint8_t srcBuff[BUFFER_SIZE];&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;static uint8_t destBuff[BUFFER_SIZE];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;spi_master_config_t userConfig = {0};&lt;BR /&gt; uint32_t srcFreq = 0;&lt;BR /&gt; uint32_t i = 0;&lt;BR /&gt; uint32_t err = 0;&lt;BR /&gt; spi_transfer_t xfer = {0};&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;for (i = 0; i &amp;lt; BUFFER_SIZE; i++)&lt;BR /&gt; {&lt;BR /&gt; srcBuff[BUFFER_SIZE] = 0xA5;&lt;BR /&gt; }&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; SPI_MasterGetDefaultConfig(&amp;amp;userConfig);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; srcFreq = EXAMPLE_SPI_MASTER_CLK_FREQ;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; userConfig.sselNum = (spi_ssel_t)EXAMPLE_SPI_SSEL;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; userConfig.sselPol = (spi_spol_t)EXAMPLE_SPI_SPOL;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; userConfig.dataWidth = kSPI_Data10Bits;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; SPI_MasterInit(EXAMPLE_SPI_MASTER, &amp;amp;userConfig, srcFreq);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; //Start Transfer&lt;BR /&gt; xfer.txData = srcBuff;&lt;BR /&gt; xfer.rxData = destBuff;&lt;BR /&gt; xfer.dataSize = 2;&lt;BR /&gt; xfer.configFlags = kSPI_FrameAssert;&lt;BR /&gt;&amp;nbsp;SPI_MasterTransferBlocking(EXAMPLE_SPI_MASTER, &amp;amp;xfer);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I go and just change to 9 bits with&lt;EM&gt; userConfig.dataWidth = kSPI_Data9Bits;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;it jumps to clocking out 18bits.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So how can I get the elusive 9 bits?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2020 13:08:14 GMT</pubDate>
    <dc:creator>iann</dc:creator>
    <dc:date>2020-08-04T13:08:14Z</dc:date>
    <item>
      <title>17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096979#M42037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm looking to interface to a slightly non standard spi interface using a 9bit address word as shown below to make a 17 or 25 bit total frame size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/108943iC066204EF211485A/image-size/large?v=v2&amp;amp;px=999" title="spi17bit.png" alt="spi17bit.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the&amp;nbsp;LPC546xx manual (section 26.2) I see larger frame sizes beyond 16bits are supported by software. Are there further details on how this can be achieved? As I'd still have to interface to the 8 bit fifo's.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 13:48:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096979#M42037</guid>
      <dc:creator>iann</dc:creator>
      <dc:date>2020-07-28T13:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: 17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096980#M42038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As indicated in the manual I'm looking to do this as two transfers, one of 9bits and then the remain 8bits with I assume manual control of the EOF bit in the FIFOWR register.&lt;/P&gt;&lt;P&gt;Though I seem to be falling down at writing the initial 9bits as I get 18bits instead.&lt;/P&gt;&lt;P&gt;Following the spi sdk example I define the following.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;#define BUFFER_SIZE (2)&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;static uint8_t srcBuff[BUFFER_SIZE];&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;static uint8_t destBuff[BUFFER_SIZE];&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;spi_master_config_t userConfig = {0};&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;spi_transfer_t xfer = {0};&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt; SPI_MasterGetDefaultConfig(&amp;amp;userConfig);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; srcFreq = EXAMPLE_SPI_MASTER_CLK_FREQ;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; userConfig.sselNum = (spi_ssel_t)EXAMPLE_SPI_SSEL;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; userConfig.sselPol = (spi_spol_t)EXAMPLE_SPI_SPOL;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; userConfig.dataWidth = kSPI_Data9Bits;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;BR /&gt;&lt;EM&gt; SPI_MasterInit(EXAMPLE_SPI_MASTER, &amp;amp;userConfig, srcFreq);&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;//Start Transfer&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; xfer.txData = srcBuff;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; xfer.rxData = destBuff;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; xfer.dataSize = 2;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; xfer.configFlags = kSPI_FrameAssert;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;SPI_MasterTransferBlocking(EXAMPLE_SPI_MASTER, &amp;amp;xfer);&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;How should I be using the datawidth register?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ian.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 14:33:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096980#M42038</guid>
      <dc:creator>iann</dc:creator>
      <dc:date>2020-07-28T14:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: 17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096981#M42039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the APIs in the SDK support transfer up to 16 bit.&amp;nbsp;In this case, in your code you're setting 2 transfer of 9 bits, so you would need to set first a 9-bit transfer first, modify the data width, and set other transfer with the flags&amp;nbsp;kSPI_FrameDelay and kSPI_FrameAssert to indicate the end of the frame.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2020 15:54:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096981#M42039</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-07-29T15:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: 17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096982#M42040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexis thanks for the reply, this is what I was trying to achieve, though I can't see how to send just 1 transfer of 9bits as if I sent&amp;nbsp;&amp;nbsp;&lt;EM style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;xfer.dataSize = 1;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;at runtime I get an&amp;nbsp;ASSERT ERROR " .fsl_spi.c:544 : !((dataWidth &amp;gt; kSPI_Data8Bits) &amp;amp;&amp;amp; ((xfer-&amp;gt;dataSize &amp;amp; 0x1U) != 0U))&amp;nbsp;&lt;/P&gt;&lt;P&gt;not surprisingly as the api for the&amp;nbsp;spi_transfer_t&amp;nbsp; has data as 8bits.&lt;/P&gt;&lt;P&gt;So how can I just send 1 transfer of 9bits though the api?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2020 10:06:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096982#M42040</guid>
      <dc:creator>iann</dc:creator>
      <dc:date>2020-07-30T10:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: 17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096983#M42041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're right, it looks like when the driver recognizes a transfer higher than 8-bits the extra bits will put in the next byte, so you will need to filter the information in the second byte.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2020 15:15:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096983#M42041</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-07-31T15:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: 17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096984#M42042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexis this is what I'm trying to do, but there seems to be a problem with this particular combination as if I do a 10bit transfer I get what I expect 10 bits clocked out per frame with&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#define BUFFER_SIZE (2)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;static uint8_t srcBuff[BUFFER_SIZE];&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;static uint8_t destBuff[BUFFER_SIZE];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;spi_master_config_t userConfig = {0};&lt;BR /&gt; uint32_t srcFreq = 0;&lt;BR /&gt; uint32_t i = 0;&lt;BR /&gt; uint32_t err = 0;&lt;BR /&gt; spi_transfer_t xfer = {0};&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;for (i = 0; i &amp;lt; BUFFER_SIZE; i++)&lt;BR /&gt; {&lt;BR /&gt; srcBuff[BUFFER_SIZE] = 0xA5;&lt;BR /&gt; }&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; SPI_MasterGetDefaultConfig(&amp;amp;userConfig);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; srcFreq = EXAMPLE_SPI_MASTER_CLK_FREQ;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; userConfig.sselNum = (spi_ssel_t)EXAMPLE_SPI_SSEL;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; userConfig.sselPol = (spi_spol_t)EXAMPLE_SPI_SPOL;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; userConfig.dataWidth = kSPI_Data10Bits;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; SPI_MasterInit(EXAMPLE_SPI_MASTER, &amp;amp;userConfig, srcFreq);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; //Start Transfer&lt;BR /&gt; xfer.txData = srcBuff;&lt;BR /&gt; xfer.rxData = destBuff;&lt;BR /&gt; xfer.dataSize = 2;&lt;BR /&gt; xfer.configFlags = kSPI_FrameAssert;&lt;BR /&gt;&amp;nbsp;SPI_MasterTransferBlocking(EXAMPLE_SPI_MASTER, &amp;amp;xfer);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I go and just change to 9 bits with&lt;EM&gt; userConfig.dataWidth = kSPI_Data9Bits;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;it jumps to clocking out 18bits.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So how can I get the elusive 9 bits?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2020 13:08:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096984#M42042</guid>
      <dc:creator>iann</dc:creator>
      <dc:date>2020-08-04T13:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: 17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096985#M42043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried using one transmission with for example 11 bit-s and the other one for 8-bit? This to have one filtered transmission and the other to received as it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2020 16:37:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096985#M42043</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-08-04T16:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: 17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096986#M42044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes all the other combinations work, 10bits through to 16 bits. It's just the one I need 9bits that doesn't, so I assume there's an error in the sdk, is there a fix?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2020 09:10:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096986#M42044</guid>
      <dc:creator>iann</dc:creator>
      <dc:date>2020-08-05T09:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: 17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096987#M42045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the first part of the problem, sending a 9 bit transfer I found an issue in the sdk (version 2.7)&amp;nbsp;&lt;/P&gt;&lt;P&gt;in fsl_spi.c&amp;nbsp; lines 562 to 618 the two lines in bold need changing.&lt;/P&gt;&lt;P&gt;&lt;EM&gt; while ((txRemainingBytes != 0U) || (rxRemainingBytes != 0U) || (toReceiveCount != 0U))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; /* if rxFIFO is not empty */&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; if ((base-&amp;gt;FIFOSTAT &amp;amp; SPI_FIFOSTAT_RXNOTEMPTY_MASK) != 0U)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; tmp32 = base-&amp;gt;FIFORD;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; /* rxBuffer is not empty */&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; if (rxRemainingBytes != 0U)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; *(rxData++) = (uint8_t)tmp32;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; rxRemainingBytes--;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; /* read 16 bits at once */&lt;/EM&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; if (dataWidth &amp;gt;= 8U)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp; was&amp;nbsp;if (dataWidth &amp;gt;8U)&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt; {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; *(rxData++) = (uint8_t)(tmp32 &amp;gt;&amp;gt; 8);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; rxRemainingBytes--;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; /* decrease number of data expected to receive */&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; toReceiveCount -= 1U;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; /* transmit if txFIFO is not full and data to receive does not exceed FIFO depth */&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; if (((base-&amp;gt;FIFOSTAT &amp;amp; SPI_FIFOSTAT_TXNOTFULL_MASK) != 0U) &amp;amp;&amp;amp; (toReceiveCount &amp;lt; fifoDepth) &amp;amp;&amp;amp;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; ((txRemainingBytes != 0U) || (rxRemainingBytes &amp;gt;= SPI_COUNT_TO_BYTES(dataWidth, toReceiveCount + 1U))))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; /* txBuffer is not empty */&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; if (txRemainingBytes != 0U)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; tmp32 = *(txData++);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; txRemainingBytes--;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; /* write 16 bit at once */&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt; if (dataWidth &amp;gt;= 8U)&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;//&amp;nbsp; was&amp;nbsp;if (dataWidth &amp;gt;8U)&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; tmp32 |= ((uint32_t)(*(txData++))) &amp;lt;&amp;lt; 8U;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; txRemainingBytes--;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; if (txRemainingBytes == 0U)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; tx_ctrl |= last_ctrl;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; else&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; tmp32 = (uint32_t)s_dummyData[instance];&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; tmp32 |= (uint32_t)s_dummyData[instance] &amp;lt;&amp;lt; 8U;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; /* last transfer */&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; if (rxRemainingBytes == SPI_COUNT_TO_BYTES(dataWidth, toReceiveCount + 1U))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; tx_ctrl |= last_ctrl;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; /* send data */&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; tmp32 = tx_ctrl | tmp32;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; base-&amp;gt;FIFOWR = tmp32;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; toReceiveCount += 1U;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that gets changed in a later sdk version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ian.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2020 14:51:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096987#M42045</guid>
      <dc:creator>iann</dc:creator>
      <dc:date>2020-08-06T14:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: 17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096988#M42046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the second part of the problem then sending an 8 bit transfer, I can't see how to get the new value of&amp;nbsp;userConfig.dataWidth = kSPI_Data8Bits;&amp;nbsp; to take effect? As just updating this is ignored.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also tried&amp;nbsp;running the SPI_Deinit and then SPI_MasterInit again with the new value but not surprisingly this causes the bus to reset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the correct way to do a two transaction spi transfer&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;changing the spi&amp;nbsp; datawidth in between?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2020 15:05:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096988#M42046</guid>
      <dc:creator>iann</dc:creator>
      <dc:date>2020-08-06T15:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: 17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096989#M42047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ian,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The changes you made are totally right, I will report this to the SDK team, and about your other question, the best way would be to change the data width in the section the master init is storing this configuration. This configuration is stored in&amp;nbsp;g_configs so an API like the next one should do the trick:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;status_t &lt;SPAN class="token function"&gt;SPI_ChangeTransferWidth&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SPI_Type &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;base&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; spi_data_width_t datawidth&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    uint32_t instance&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    
    instance  &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;SPI_GetInstance&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;base&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;/* store configuration */&lt;/SPAN&gt;
    g_configs&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;instance&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dataWidth &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; datawidth&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2020 20:38:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096989#M42047</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-08-06T20:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: 17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096990#M42048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Alexis, that's the missing piece I needed.&lt;/P&gt;&lt;P&gt;To close this off now, my waveforms now are&amp;nbsp;&lt;/P&gt;&lt;P&gt;17bits&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/110105i9123823BF2C71BE7/image-size/large?v=v2&amp;amp;px=999" title="17bits.jpg" alt="17bits.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and 25bits&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/110136iCB72385A47365450/image-size/large?v=v2&amp;amp;px=999" title="25bits.jpg" alt="25bits.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2020 09:28:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1096990#M42048</guid>
      <dc:creator>iann</dc:creator>
      <dc:date>2020-08-07T09:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: 17bit or 25bit spi frame using LPC546xx family</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1190869#M43087</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Hi Alexis,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I'm having to revisit this as now we're trying to get our prototype hardware up and running I've switched to using the freeRTOS spi functions which use the&amp;nbsp;SPI_MasterTransferNonBlocking functions in the fsl_spi.c driver and this is showing the original problem of not being able to change the bit width as there a way to modify the function to allow this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 10:30:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/17bit-or-25bit-spi-frame-using-LPC546xx-family/m-p/1190869#M43087</guid>
      <dc:creator>iann</dc:creator>
      <dc:date>2020-11-30T10:30:07Z</dc:date>
    </item>
  </channel>
</rss>

