<?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: Howto: 20-bit SPI transfer using SSP? in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797881#M32086</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kerry, but we need &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;hardware&lt;/STRONG&gt;&lt;/SPAN&gt; to control CS properly; no software involvement until ADC data is read into SRAM, and no CPU involvement to output DAC values. If we used GPIO for CS, can the DMA of LPC parts frame the SPI transfer with proper CS assert-deassert using DMA chaining? Or perhaps controlled by a timer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can't control CS SPI framing in software, otherwise we end up spending a huge % of available CPU time mucking about with the SPI transfer; absolutely not OK in our applications.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should we give up on LPC parts and use Kinetis, which can do 20-bit SPI easily with Kinetis' SPI controller? &lt;/P&gt;&lt;P&gt;Are Kinetis not recommended for new designs? I don't see any new parts or new smaller packages for Kinetis?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Oct 2018 15:02:01 GMT</pubDate>
    <dc:creator>davenadler</dc:creator>
    <dc:date>2018-10-17T15:02:01Z</dc:date>
    <item>
      <title>Howto: 20-bit SPI transfer using SSP?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797879#M32084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Considering using LPC MCUs for a project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need to interface to devices with 20-bit SPI frames, which is very common (for 20-bit ADCs, DACs, etc); for example:&lt;/P&gt;&lt;P&gt;&lt;A data-value="http://www.ti.com/lit/ds/symlink/ads8904b.pdf" dir="ltr" href="http://www.ti.com/lit/ds/symlink/ads8904b.pdf" title=""&gt;http://www.ti.com/lit/ds/symlink/ads8904b.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A data-value="https://www.maximintegrated.com/en/ds/MAX5717-MAX5719.pdf" href="https://www.maximintegrated.com/en/ds/MAX5717-MAX5719.pdf" title=""&gt;https://www.maximintegrated.com/en/ds/MAX5717-MAX5719.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;Note in particular the CS requirements in the either datasheet above (CS must be held low for 20-bit duration).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;There many other 20-bit SPI parts with similar requirements.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;I had a quick read of the LPC176x SSP description here: &lt;A class="link-titled" href="https://www.nxp.com/docs/en/user-guide/UM10360.pdf" title="https://www.nxp.com/docs/en/user-guide/UM10360.pdf"&gt;https://www.nxp.com/docs/en/user-guide/UM10360.pdf&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;I can't see how one does a transfer longer than 16 bits (which is supported for example on Kinetis SPI).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;How does one do a 20-bit SPI transfer?&lt;BR /&gt;Does this apply across all LPC family devices or do some have different SPI capabilities?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;Thanks in advance,&lt;BR /&gt;Best Regards, Dave&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 14:52:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797879#M32084</guid>
      <dc:creator>davenadler</dc:creator>
      <dc:date>2018-10-16T14:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Howto: 20-bit SPI transfer using SSP?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797880#M32085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dave Nadler,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; LPC176X ssp can't support the 20bit SPI directly.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76148i0EEA3FF3BCF09ECF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So, if you really want to use 20bit SPI, you need to use the GPIO to simulate it.&lt;/P&gt;&lt;P&gt;About the CS &lt;SPAN class="" dir="ltr"&gt;requirements, it's easy to realize it, just use the GPIO to control it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;But I have roughly review your SPI slaves:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;1. ADS8904B from IT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;page 37&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76271i0CC6BFA251C1E4CD/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;You can find it actually need 22 clocks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;So, I think if you need to use SSP, you can use two 11 bits:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76312i2290F8113A1CFFAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;The CS can be controlled by the GPIO, don't use the SSP hardware CS function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;About the data, after you received two 11bits, you can combine two 11bits data together.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;2. max5717 from maximintegrated&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;page 10.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_7.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76409iCC30D217EBDB9FF9/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_7.png" alt="pastedImage_7.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;You can find it is the 24 clocks, so you can use two 12 bits SSP or 3 8-bits SSP, then combine it together.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;The CS pin still be controlled by the GPIO.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;As I know, the SPI module in the LPC series, no chip can support 20 bits directly, so you need to divide it, or use the GPIO to simulate it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" dir="ltr"&gt;Wish it helps you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Kerry&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>Wed, 17 Oct 2018 03:02:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797880#M32085</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-10-17T03:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Howto: 20-bit SPI transfer using SSP?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797881#M32086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kerry, but we need &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;hardware&lt;/STRONG&gt;&lt;/SPAN&gt; to control CS properly; no software involvement until ADC data is read into SRAM, and no CPU involvement to output DAC values. If we used GPIO for CS, can the DMA of LPC parts frame the SPI transfer with proper CS assert-deassert using DMA chaining? Or perhaps controlled by a timer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can't control CS SPI framing in software, otherwise we end up spending a huge % of available CPU time mucking about with the SPI transfer; absolutely not OK in our applications.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should we give up on LPC parts and use Kinetis, which can do 20-bit SPI easily with Kinetis' SPI controller? &lt;/P&gt;&lt;P&gt;Are Kinetis not recommended for new designs? I don't see any new parts or new smaller packages for Kinetis?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2018 15:02:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797881#M32086</guid>
      <dc:creator>davenadler</dc:creator>
      <dc:date>2018-10-17T15:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Howto: 20-bit SPI transfer using SSP?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797882#M32087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dave,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hardware control CS idle state is determined by the status, please check this information:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76066i838FC21E07A643DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76067i6472C530D97A6A29/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76188iA329FDD097E34C03/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if you want to use the hardware control, maybe you need to choose CPHA=1, but you need to check your SPI slave, if you choose this method, your slave should also have the same CPHA. Otherwise CPHA=0, the SSEL will be pull to idle status after each data word transfer.&lt;/P&gt;&lt;P&gt;If you are using DMA, you can consider to use the CPHA=1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&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>Thu, 18 Oct 2018 06:44:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797882#M32087</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-10-18T06:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Howto: 20-bit SPI transfer using SSP?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797883#M32088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kerry, you have &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;/SPAN&gt; answered the question. Can you confirm:&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;LPC MCUs hardware cannot support 20-bit SPI transfer bracketed by CS low without software bit-banging of at least CS control. No work-around using timers and/or DMA is possible; CPU involvement is required.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Best Regards, Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2018 15:33:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797883#M32088</guid>
      <dc:creator>davenadler</dc:creator>
      <dc:date>2018-10-18T15:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Howto: 20-bit SPI transfer using SSP?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797884#M32089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dave Nadler,&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1. Yes, MCU can't support 20bit directly, but please check your slaver, actually it is 24 bits, so just as I told you, you can use 3*8bits to replace the 24bits. even it is the 20bits, you can use 2*10bits to replace it. But the data you need to prepare it in divide mode, then combine it together by yourself.&lt;/P&gt;&lt;P&gt;2. If the CS is low without software GPIO control, you need to use CPHA=1, this mode can keep the CS low without GPIO control. But CPHA=0, you still need to control it with the software. If you want to use the timers or DMA to control the CS, of course you can, but how to synchronize the SPI with the GPIO CS correctly is a problem, it will make problem more complicated. So, if you can't use CPHA=1, maybe you really need to consider to use cpu involvement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;If you still have question about it, please kindly let me know.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&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>Fri, 19 Oct 2018 03:03:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Howto-20-bit-SPI-transfer-using-SSP/m-p/797884#M32089</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-10-19T03:03:48Z</dc:date>
    </item>
  </channel>
</rss>

