<?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: High interrupt delay from HSADC in LPC4370</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925816#M36900</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;I'm doing something similar in my application and I think there is no way to get rid of this. The IRQ call is 12 clk cycles so you'll always have some sort of delay unfortunately.&lt;BR /&gt;How do you measure the delay time?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 14 Sep 2019 13:43:42 GMT</pubDate>
    <dc:creator>a_bet</dc:creator>
    <dc:date>2019-09-14T13:43:42Z</dc:date>
    <item>
      <title>High interrupt delay from HSADC threshold trigger in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925815#M36899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. We are creating a program for LPC4370 that collects samples from HSADC in the RAM buffer using DMA. The program uses the HSADC threshold functionality, which, when triggered, calls the ADCHS_IRQHandler interrupt handler. This ISR handler is located in RAM to speed up processing. Immediately at start, the handler saves the current position in the memory at which the recording from DMA is going.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the delay between the triggering of the HSADC threshold and the call of the interrupt handler is about 1.5 μs, which is quite a lot at a sample frequency of 80 MHz. Tell us, please, what is the reason for such a big delay and how to fix it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Sep 2019 09:39:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925815#M36899</guid>
      <dc:creator>vitaliylivnov</dc:creator>
      <dc:date>2019-09-14T09:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925816#M36900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;I'm doing something similar in my application and I think there is no way to get rid of this. The IRQ call is 12 clk cycles so you'll always have some sort of delay unfortunately.&lt;BR /&gt;How do you measure the delay time?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Sep 2019 13:43:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925816#M36900</guid>
      <dc:creator>a_bet</dc:creator>
      <dc:date>2019-09-14T13:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925817#M36901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Andrea. Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We use a synchronization functionality similar to that implemented in LabTool. When ISR is triggered, the current DMA record address is stored, after which a certain number of HSADC samples are recorded and then the data is transferred to the PC. In the screenshot you can see that the interrupt triggered at position 0 on the x axis, and the HSADC trigger fired 120 samples earlier. This is about 1.5 μs of delay.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2019-09-14.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/84974i21F9851643EADA82/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-09-14.png" alt="2019-09-14.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second measurement method is to switch one of the GPIO pins immediately after the interrupt is triggered and measure the delay time using an oscilloscope. In this case, we got similar results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tell us, how did you manage to get a delay of 12 clk cycles?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Sep 2019 19:52:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925817#M36901</guid>
      <dc:creator>vitaliylivnov</dc:creator>
      <dc:date>2019-09-14T19:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925818#M36902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm afraid you forgot to attach the image but don't worry I understood.&lt;BR /&gt;My application samples continuously so it's a bit different, but I never actually measured the time.&lt;BR /&gt;I wrote that because I learned it on &lt;A href="https://www.amazon.com/Definitive-Guide-Cortex%C2%AE-M3-Cortex%C2%AE-M4-Processors/dp/0124080820"&gt;this&lt;/A&gt; book.&lt;BR /&gt;It's strange that you get so much delay. Maybe it could be related with the ADC wakeup time?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Sep 2019 16:36:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925818#M36902</guid>
      <dc:creator>a_bet</dc:creator>
      <dc:date>2019-09-15T16:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925819#M36903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="308151" data-username="vitaliylivnov" href="https://community.nxp.com/people/vitaliylivnov"&gt;Vitaliy Livnov&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Andrea Bettati pointed out that it took 12 clock cycles to execute the first instruction in ISR after interrupt is triggered.&lt;/P&gt;&lt;P&gt;But assume that the LPC4357 run in 200MHz, executing 12 clock cycles takes about 0.1uS, but you said the delay is 1.5uS, it is too ling. If you do&amp;nbsp; nothing in the ADC ISR but toggling a GPIO, then check the ADC triggering signal and the GPIO toggling signal, what is the result?&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Sep 2019 05:57:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925819#M36903</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2019-09-16T05:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC threshold in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925820#M36904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/a_bet"&gt;a_bet&lt;/A&gt;‌, &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/xiangjun.rong"&gt;xiangjun.rong&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;Thanks for yor answers.&amp;nbsp;I apologize for forgetting to attach a screenshot, I attach it to the post above.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Also, I apparently incorrectly described the principle of our software. This is not an interrupt from the trigger that triggers the HSADC, but an interrupt that fires when the signal crosses the threshold level (THCMP_UCROSS0). I fixed this in the description of the question. We do not stop the HSADC before the synchronization is triggered or immediately after the synchronization, but only modify the DMA LLI descriptors in the HSADC threshold ISR handler. That is, our software is an oscilloscope functional with synchronization on the leading edge of the signal. And as you can see from the screenshot above, the synchronization is delayed by about 120 samples at an ADC frequency of 80 MHz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Sep 2019 08:00:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925820#M36904</guid>
      <dc:creator>vitaliylivnov</dc:creator>
      <dc:date>2019-09-16T08:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC threshold in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925821#M36905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello to all.&lt;/P&gt;&lt;P&gt;We tested the LabTool software and also got a threshold interrupt delay of&lt;/P&gt;&lt;P&gt;about 1 μs. Does this mean that this is a LPC4370 hardware problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Sep 2019 19:05:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925821#M36905</guid>
      <dc:creator>vitaliylivnov</dc:creator>
      <dc:date>2019-09-21T19:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC threshold in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925822#M36906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Vitaliy,&lt;/P&gt;&lt;P&gt;I read your description carefully, but I do not know the timing of the delay. Can you draw a timing diagram and clarify what the synchronization is, what the delay is, for example delay is from an instant to another instant.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 08:00:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925822#M36906</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2019-09-23T08:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC threshold in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925823#M36907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/xiangjun.rong" rel="noopener noreferrer" target="_blank"&gt;xiangjun.rong&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;Thanks for your reply. By synchronization, I mean a trigger on the edge of the signal, as in an oscilloscope (see attached picture). I call it synchronization so that there is no confusion with the start trigger of HSADC.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="52f3bc56ce395ff46a8b4567.jpg"&gt;&lt;IMG alt="52f3bc56ce395ff46a8b4567.jpg" src="https://community.nxp.com/t5/image/serverpage/image-id/88687i9D672E54E89C5776/image-size/large?v=v2&amp;amp;px=999" title="52f3bc56ce395ff46a8b4567.jpg" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;In the chart above, the trigger is set to the position x = 0, y = 0, and if there were no delay the signal would cross this point. However, the signal crossed the point x = -120, y = 0, respectively, we have a delay of 120 samples of HSADC.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I’ll try to explain the problem with an example.&lt;/DIV&gt;&lt;DIV&gt;We set up the HSADC threshold level as follows:&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;/* Set low A threshold to 50% and high A threshold to 50% */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define TRIGGER_LEVEL_DEF (HSADC_MAX_SAMPLEVAL / 2)&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;Chip_HSADC_SetThrLowValue&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LPC_ADCHS&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; TRIGGER_LEVEL_DEF&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;Chip_HSADC_SetThrHighValue&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LPC_ADCHS&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; TRIGGER_LEVEL_DEF&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍
&lt;SPAN class="comment token"&gt;/* Setup HSADC threshold interrupts on group 1 */&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;/* Input 0 upward threshold crossing detect */&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;Chip_HSADC_EnableInts&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LPC_ADCHS&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;HSADC_INT1_THCMP_UCROSS&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/DIV&gt;&lt;DIV&gt;In the HSADC interrupt handler, we simply switch the debug output of the microcontroller:&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;__RAM_FUNC &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ADCHS_IRQHandler&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;/* Toggle debug pin */&lt;/SPAN&gt;
 LPC_GPIO_PORT&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;B&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 LPC_GPIO_PORT&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;B&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

 &lt;SPAN class="comment token"&gt;/* Get threshold interrupt status on group 1 */&lt;/SPAN&gt;
 uint32_t status &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Chip_HSADC_GetIntStatus&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LPC_ADCHS&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Chip_HSADC_GetEnabledInts&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LPC_ADCHS&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;/* Clear threshold interrupts statuses */&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;Chip_HSADC_ClearIntStatus&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LPC_ADCHS&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; status&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/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;We connected the first channel (yellow beam) of the external oscilloscope to the input of the HSADC, and the second channel (blue beam) to the debug output of the microcontroller. You can see in the figure below a delay of about 1.5 μs between the crossing of the threshold level of the HSADC and the triggering of the interrupt.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="12.BMP"&gt;&lt;IMG alt="12.BMP" src="https://community.nxp.com/t5/image/serverpage/image-id/88714i4E625FAE03B0BA09/image-size/large?v=v2&amp;amp;px=999" title="12.BMP" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;P.S.&amp;nbsp;During the check, we noticed that when we turn on code optimization (O3), the delay decreases to 250 ns (see the picture below), but this is also a lot and the code works with errors.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="SDS00003.BMP"&gt;&lt;IMG alt="SDS00003.BMP" src="https://community.nxp.com/t5/image/serverpage/image-id/88808i369A973501A5CA14/image-size/large?v=v2&amp;amp;px=999" title="SDS00003.BMP" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:24:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925823#M36907</guid>
      <dc:creator>vitaliylivnov</dc:creator>
      <dc:date>2020-11-02T14:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC threshold trigger in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925824#M36908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Vitaliy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the phenomenon is strange, maybe the root cause is complicated, this is my guess, I do not make sure it is correct.&lt;/P&gt;&lt;P&gt;I checked your ADC ISR&lt;/P&gt;&lt;PRE class=""&gt;&lt;CODE&gt;__RAM_FUNC &lt;SPAN class=""&gt;void&lt;/SPAN&gt; &lt;SPAN class=""&gt;ADCHS_IRQHandler&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;void&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;/* Toggle debug pin */&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LPC_GPIO_PORT&lt;SPAN class=""&gt;-&amp;gt;&lt;/SPAN&gt;B&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;3&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;7&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LPC_GPIO_PORT&lt;SPAN class=""&gt;-&amp;gt;&lt;/SPAN&gt;B&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;3&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;7&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;/* Get threshold interrupt status on group 1 */&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;uint32_t status &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;Chip_HSADC_GetIntStatus&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;LPC_ADCHS&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class=""&gt;Chip_HSADC_GetEnabledInts&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;LPC_ADCHS&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;/* Clear threshold interrupts statuses */&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;Chip_HSADC_ClearIntStatus&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;LPC_ADCHS&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; status&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;
&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/CODE&gt;

You use the status variable, and the&lt;PRE class=""&gt;&lt;CODE&gt; &lt;SPAN class=""&gt;ADCHS_IRQHandler&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;void&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/CODE&gt; code is located at RAM, pls check if the&lt;PRE class=""&gt; status variable, &lt;CODE&gt;&lt;SPAN class=""&gt;ADCHS_IRQHandler&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;void&lt;/SPAN&gt;&lt;SPAN class=""&gt;) code location and DMA destination address where you save the ADC samples are 
located at the same RAM block, if it is, there is issue,
 pls allocate them to different RAM blocks so that DMA and core can work in parallel.
Hope it can help you
BR
Xiangjun Rong

&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Sep 2019 09:10:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925824#M36908</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2019-09-25T09:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC threshold trigger in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925825#M36909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/xiangjun.rong"&gt;xiangjun.rong&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;Thank you for your offer. We moved the DMA destination buffer to RAM2, and left the ADCHS_IRQHandler in RAM alias. Also, the status stack variable has been made global in RAM. However, this did not bring any result.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Tell us, please, is it possible to perform debugging, or at least see the assembler code from the moment the interrupt from the HSADC is generated and until the ADCHS_IRQHandler function is called to understand how many CPU clock cycles are required for this path?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Sep 2019 19:32:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925825#M36909</guid>
      <dc:creator>vitaliylivnov</dc:creator>
      <dc:date>2019-09-25T19:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC threshold trigger in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925826#M36910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Vitaliy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not think any&amp;nbsp; debugger tools can provide the function to calculate the time from the instant that interrupt is triggered to the instant that the first instruction is executed in ISR, because we can not capture the instant that interrupt is triggered from processor itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Xiangjun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2019 02:38:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925826#M36910</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2019-09-26T02:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC threshold trigger in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925827#M36911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/xiangjun.rong"&gt;xiangjun.rong&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;And what preparatory operations does the processor carry out from the instance the interrupt is triggered until the interrupt handler is called?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2019 18:45:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925827#M36911</guid>
      <dc:creator>vitaliylivnov</dc:creator>
      <dc:date>2019-09-27T18:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: High interrupt delay from HSADC threshold trigger in LPC4370</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925828#M36912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. We inform that we solved the problem by moving the ISR vector table to RAM. Thanks to everyone who tried to help.&lt;/P&gt;&lt;DIV style="position: absolute; left: 366px; top: 5.62264px;"&gt;&lt;DIV class="gtx-trans-icon"&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2019 19:38:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/High-interrupt-delay-from-HSADC-threshold-trigger-in-LPC4370/m-p/925828#M36912</guid>
      <dc:creator>vitaliylivnov</dc:creator>
      <dc:date>2019-10-09T19:38:17Z</dc:date>
    </item>
  </channel>
</rss>

