<?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: LPC55s69 ADC cannot read with watermark &amp;gt; 0 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s69-ADC-cannot-read-with-watermark-gt-0/m-p/2099417#M58198</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/247125"&gt;@waliwalabo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;“&lt;/P&gt;
&lt;P&gt;The issue I have is that&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;the code is stuck at&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;P&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(false == g_DmaTransferDoneFlag)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PRINTF(&lt;/SPAN&gt;&lt;SPAN&gt;"3\r\n"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;”&lt;/P&gt;
&lt;P&gt;This proves that DMA is not worked.&lt;/P&gt;
&lt;P&gt;This may be due to ADC not being configured correctly or DMA not being configured correctly.&lt;/P&gt;
&lt;P&gt;I think you can check the adc dma registers between sdk demo and your code in debug moed.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Harry_Zhang_0-1747624178624.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/338363i4836D2AC18D8EAE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Harry_Zhang_0-1747624178624.png" alt="Harry_Zhang_0-1747624178624.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 May 2025 03:09:53 GMT</pubDate>
    <dc:creator>Harry_Zhang</dc:creator>
    <dc:date>2025-05-19T03:09:53Z</dc:date>
    <item>
      <title>LPC55s69 ADC cannot read with watermark &gt; 0</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s69-ADC-cannot-read-with-watermark-gt-0/m-p/2099229#M58197</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use ADC receive 10 data a time and doing average.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is almost the same from the adc example, in which the adc acquire 3 samples and do averaging.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main difference is I used config tool -&amp;gt; peripherals to setup my ADC and DMA, here is the parameters:&amp;nbsp;&lt;/P&gt;&lt;P&gt;ADC:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="waliwalabo_0-1747436098967.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/338304iB3BFE1F5DC02E2B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="waliwalabo_0-1747436098967.png" alt="waliwalabo_0-1747436098967.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="waliwalabo_1-1747436113996.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/338305i7B72748948A0F497/image-size/medium?v=v2&amp;amp;px=400" role="button" title="waliwalabo_1-1747436113996.png" alt="waliwalabo_1-1747436113996.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;DMA:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="waliwalabo_2-1747436142197.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/338306iD89F35A5E3D2E3CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="waliwalabo_2-1747436142197.png" alt="waliwalabo_2-1747436142197.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I copy the code from the example "lpcxpresso55s69_lpadc_dma":&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;g_DmaTransferDoneFlag = false;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPADC_DoSoftwareTrigger(ADC0, 1UL);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;&lt;SPAN&gt; ((LPADC_GetStatusFlags(ADC0) &amp;amp; RESULT_FIFO_READY_FLAG) == 0UL)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PRINTF(&lt;/SPAN&gt;&lt;SPAN&gt;"1\r\n"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PRINTF(&lt;/SPAN&gt;&lt;SPAN&gt;"2\r\n"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DMA_StartTransfer(&amp;amp;DMA0_CH0_Handle);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;&lt;SPAN&gt; (false == g_DmaTransferDoneFlag)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PRINTF(&lt;/SPAN&gt;&lt;SPAN&gt;"3\r\n"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;uint16_t&lt;/SPAN&gt;&lt;SPAN&gt; adc_val = (&lt;/SPAN&gt;&lt;SPAN&gt;uint16_t&lt;/SPAN&gt;&lt;SPAN&gt;)(g_avgADCValue &amp;amp; ADC_RESFIFO_D_MASK);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (adc_index &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;sizeof&lt;/SPAN&gt;&lt;SPAN&gt;(adc_data_buffer)/&lt;/SPAN&gt;&lt;SPAN&gt;sizeof&lt;/SPAN&gt;&lt;SPAN&gt;(adc_data_buffer[0])) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;adc_data_buffer[adc_index++] = adc_val;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue I have is that &lt;STRONG&gt;the code is stuck at&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;&lt;SPAN&gt; (false == g_DmaTransferDoneFlag)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PRINTF(&lt;/SPAN&gt;&lt;SPAN&gt;"3\r\n"&lt;/SPAN&gt;&lt;SPAN&gt;);&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;&lt;STRONG&gt;unless the "FIFO0 WATERMARK" in the peripheral was changed to 0.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;I tried to compare the auto generated pheripherals.c with the ADC_Configuration(void) in the example but no luck.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Did I miss some codes, or mass up with some setup?&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 16 May 2025 23:02:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s69-ADC-cannot-read-with-watermark-gt-0/m-p/2099229#M58197</guid>
      <dc:creator>waliwalabo</dc:creator>
      <dc:date>2025-05-16T23:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55s69 ADC cannot read with watermark &gt; 0</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s69-ADC-cannot-read-with-watermark-gt-0/m-p/2099417#M58198</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/247125"&gt;@waliwalabo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;“&lt;/P&gt;
&lt;P&gt;The issue I have is that&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;the code is stuck at&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;P&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(false == g_DmaTransferDoneFlag)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PRINTF(&lt;/SPAN&gt;&lt;SPAN&gt;"3\r\n"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;”&lt;/P&gt;
&lt;P&gt;This proves that DMA is not worked.&lt;/P&gt;
&lt;P&gt;This may be due to ADC not being configured correctly or DMA not being configured correctly.&lt;/P&gt;
&lt;P&gt;I think you can check the adc dma registers between sdk demo and your code in debug moed.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Harry_Zhang_0-1747624178624.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/338363i4836D2AC18D8EAE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Harry_Zhang_0-1747624178624.png" alt="Harry_Zhang_0-1747624178624.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 03:09:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s69-ADC-cannot-read-with-watermark-gt-0/m-p/2099417#M58198</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2025-05-19T03:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55s69 ADC cannot read with watermark &gt; 0</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s69-ADC-cannot-read-with-watermark-gt-0/m-p/2100126#M58200</link>
      <description>&lt;P&gt;Hi Harry,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your suggestion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I compared the DAM and ADC. I thought my DAM was almost identical to the example and found something interesting in ADC's register:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="waliwalabo_0-1747690587343.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/338560i1A29FDFCCCD3A6A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="waliwalabo_0-1747690587343.png" alt="waliwalabo_0-1747690587343.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I took the screen shot when my firmware stuck at the while loop, and FCTRL[0] = 0x00090007.&lt;/P&gt;&lt;P&gt;According to the manual, bit 0:4 is FCOUNT.&amp;nbsp;I tried different watermark like 6 or 8 and when it got stuck, FCOUNT is always smaller than watermark by 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I changed the watermark to 2 and my code finially work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it seems that if the watermark is larger than 3, the FIFO will never receive enough data, no matter what setup I used in config tool.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I change the watermark and&amp;nbsp;&lt;SPAN&gt;SAMPLE_COUNT in the example and it stops working as well.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Did I miss something in the ADC configuration? I don't think this fifo cannot hold more than 3 words. I found FIFOSIZE in the UM and compared with the register, I can confirm that the fifo size of the example and my code is 4. Maybe this is the reason of all the issues but I didn't find the place to change it in the config tool.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="waliwalabo_2-1747691124774.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/338562i7ECBE114D46E8418/image-size/medium?v=v2&amp;amp;px=400" role="button" title="waliwalabo_2-1747691124774.png" alt="waliwalabo_2-1747691124774.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What do you think?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 21:47:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s69-ADC-cannot-read-with-watermark-gt-0/m-p/2100126#M58200</guid>
      <dc:creator>waliwalabo</dc:creator>
      <dc:date>2025-05-19T21:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55s69 ADC cannot read with watermark &gt; 0</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s69-ADC-cannot-read-with-watermark-gt-0/m-p/2103109#M58214</link>
      <description>&lt;P&gt;Hi&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;P&gt;"&lt;SPAN&gt;I change the watermark and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SAMPLE_COUNT in the example and it stops working as well.&amp;nbsp;&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P&gt;I will try to reproduce this issue in SDK demo.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 03:44:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s69-ADC-cannot-read-with-watermark-gt-0/m-p/2103109#M58214</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2025-05-23T03:44:23Z</dc:date>
    </item>
  </channel>
</rss>

