<?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 LPC5406 external pin interrupt starts ADC conversion issue in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5406-external-pin-interrupt-starts-ADC-conversion-issue/m-p/728018#M29452</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a design were I have a hardware pin on (PIO1_3) that is designed to pulse when an event occurs.&amp;nbsp; The idea is to have the internal ADC trigger a reading (ADC0) on the falling edge of the external trigger.&lt;/P&gt;&lt;P&gt;I first attach the external pin to interrupt 0 using the&amp;nbsp;INPUTMUX_AttachSignal function in fsl_inputmux.c.&lt;/P&gt;&lt;P&gt;I then start the interrupt with PINT_Init function in fsl_pint.c&lt;/P&gt;&lt;P&gt;Then I configure the interrupt to be falling edge with PINT_PinInterruptConfig in fsl_pint.c&lt;/P&gt;&lt;P&gt;I then configure the ADC to trigger on ADC0_PINTRIG0&lt;/P&gt;&lt;P&gt;When I start the ADC&amp;nbsp;interrupt it will constantly trigger even when there is no change in the PIO1_3 pin.&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a snippet of my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Enable Pin interrupt&lt;BR /&gt; CLOCK_EnableClock(kCLOCK_InputMux);&lt;BR /&gt; INPUTMUX_AttachSignal(INPUTMUX, 0, 0x23);&lt;BR /&gt; PINT_Init(PINT);&lt;BR /&gt; PINT_PinInterruptConfig(PINT, 0, kPINT_PinIntEnableFallEdge, NULL);&lt;BR /&gt; PINT_EnableCallback(PINT);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Enable ADC&lt;BR /&gt;void ADC_ADCConfiguration(void)&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adc_config_t adcConfigStruct;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adc_conv_seq_config_t adcConvSeqConfigStruct;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Configure the converter. */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConfigStruct.clockMode = kADC_ClockSynchronousMode; // Using sync clock source.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConfigStruct.clockDividerNumber = 3; // Set ADC Clock to 60MHz = 180MHz / (3 + 1)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConfigStruct.resolution = kADC_Resolution12bit; // Set ADC to 12 bit resolution&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConfigStruct.enableBypassCalibration = false; // We want to do a calibration&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConfigStruct.sampleTimeNumber = 0U; // Set 0 clock cycle before sampling starts&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ADC_Init(ADC0, &amp;amp;adcConfigStruct); // Init ADC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CLOCK_AttachClk(kSYS_PLL_to_ADC_CLK);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Calibration after power up.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if (!ADC_DoSelfCalibration(ADC0))&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DebugMessages_WriteString("ADC Cal Failure\r\n");&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Enable conversion in Sequence A.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConvSeqConfigStruct.channelMask = (1U &amp;lt;&amp;lt; ADC_HIGH_GAIN_CHANNEL); // Include High Gain Channel&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConvSeqConfigStruct.triggerMask = 1U;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConvSeqConfigStruct.triggerPolarity = kADC_TriggerPolarityNegativeEdge;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConvSeqConfigStruct.enableSingleStep = false;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConvSeqConfigStruct.enableSyncBypass = false;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConvSeqConfigStruct.interruptMode = kADC_InterruptForEachSequence; // Enable the interrupt/DMA trigger.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ADC_SetConvSeqAConfig(ADC0, &amp;amp;adcConvSeqConfigStruct);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ADC_EnableConvSeqA(ADC0, true); // Enable the conversion sequence A.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ADC_EnableInterrupts(ADC0, kADC_ConvSeqAInterruptEnable);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;NVIC_EnableIRQ(ADC0_SEQA_IRQn);&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Apr 2018 20:30:15 GMT</pubDate>
    <dc:creator>georgechancello</dc:creator>
    <dc:date>2018-04-12T20:30:15Z</dc:date>
    <item>
      <title>LPC5406 external pin interrupt starts ADC conversion issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5406-external-pin-interrupt-starts-ADC-conversion-issue/m-p/728018#M29452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a design were I have a hardware pin on (PIO1_3) that is designed to pulse when an event occurs.&amp;nbsp; The idea is to have the internal ADC trigger a reading (ADC0) on the falling edge of the external trigger.&lt;/P&gt;&lt;P&gt;I first attach the external pin to interrupt 0 using the&amp;nbsp;INPUTMUX_AttachSignal function in fsl_inputmux.c.&lt;/P&gt;&lt;P&gt;I then start the interrupt with PINT_Init function in fsl_pint.c&lt;/P&gt;&lt;P&gt;Then I configure the interrupt to be falling edge with PINT_PinInterruptConfig in fsl_pint.c&lt;/P&gt;&lt;P&gt;I then configure the ADC to trigger on ADC0_PINTRIG0&lt;/P&gt;&lt;P&gt;When I start the ADC&amp;nbsp;interrupt it will constantly trigger even when there is no change in the PIO1_3 pin.&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a snippet of my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Enable Pin interrupt&lt;BR /&gt; CLOCK_EnableClock(kCLOCK_InputMux);&lt;BR /&gt; INPUTMUX_AttachSignal(INPUTMUX, 0, 0x23);&lt;BR /&gt; PINT_Init(PINT);&lt;BR /&gt; PINT_PinInterruptConfig(PINT, 0, kPINT_PinIntEnableFallEdge, NULL);&lt;BR /&gt; PINT_EnableCallback(PINT);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Enable ADC&lt;BR /&gt;void ADC_ADCConfiguration(void)&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adc_config_t adcConfigStruct;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adc_conv_seq_config_t adcConvSeqConfigStruct;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Configure the converter. */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConfigStruct.clockMode = kADC_ClockSynchronousMode; // Using sync clock source.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConfigStruct.clockDividerNumber = 3; // Set ADC Clock to 60MHz = 180MHz / (3 + 1)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConfigStruct.resolution = kADC_Resolution12bit; // Set ADC to 12 bit resolution&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConfigStruct.enableBypassCalibration = false; // We want to do a calibration&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConfigStruct.sampleTimeNumber = 0U; // Set 0 clock cycle before sampling starts&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ADC_Init(ADC0, &amp;amp;adcConfigStruct); // Init ADC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CLOCK_AttachClk(kSYS_PLL_to_ADC_CLK);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Calibration after power up.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if (!ADC_DoSelfCalibration(ADC0))&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DebugMessages_WriteString("ADC Cal Failure\r\n");&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Enable conversion in Sequence A.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConvSeqConfigStruct.channelMask = (1U &amp;lt;&amp;lt; ADC_HIGH_GAIN_CHANNEL); // Include High Gain Channel&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConvSeqConfigStruct.triggerMask = 1U;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConvSeqConfigStruct.triggerPolarity = kADC_TriggerPolarityNegativeEdge;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConvSeqConfigStruct.enableSingleStep = false;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConvSeqConfigStruct.enableSyncBypass = false;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;adcConvSeqConfigStruct.interruptMode = kADC_InterruptForEachSequence; // Enable the interrupt/DMA trigger.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ADC_SetConvSeqAConfig(ADC0, &amp;amp;adcConvSeqConfigStruct);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ADC_EnableConvSeqA(ADC0, true); // Enable the conversion sequence A.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ADC_EnableInterrupts(ADC0, kADC_ConvSeqAInterruptEnable);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;NVIC_EnableIRQ(ADC0_SEQA_IRQn);&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2018 20:30:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5406-external-pin-interrupt-starts-ADC-conversion-issue/m-p/728018#M29452</guid>
      <dc:creator>georgechancello</dc:creator>
      <dc:date>2018-04-12T20:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: LPC5406 external pin interrupt starts ADC conversion issue</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5406-external-pin-interrupt-starts-ADC-conversion-issue/m-p/728019#M29453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="307576" data-username="georgechancellor" href="https://community.nxp.com/people/georgechancellor" style="color: #5e89c1; background-color: #ffffff; border: 0px; font-weight: 600; text-decoration: none; font-size: 11.9994px;"&gt;George Chancellor&lt;/A&gt;,&lt;/P&gt;&lt;DIV style="font-size: 14px;"&gt;&lt;SPAN style="background-color: #ffffff; font-size: 16px;"&gt;Thank you for your interest in NXP Semiconductor products and&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-size: 14px;"&gt;&lt;SPAN style="background-color: #ffffff; font-size: 16px;"&gt;the opportunity to serve you. &lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to your statement, the &lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;PIO1_3 is used to indicate whether the ADC&amp;nbsp;conservation&amp;nbsp;happens.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;So I'd like to share some suggestion with you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;1. You can check the ADC status register to confirm whether the&amp;nbsp;&lt;SPAN&gt;the ADC&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;conservation&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;happens,&amp;nbsp;and do you change the state of&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;PIO1_3 in ADC interrupt function?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;2. Using the software trigger is good first step, then move to hardware trigger later.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Have a great day,&lt;/DIV&gt;&lt;DIV style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;TIC&lt;/DIV&gt;&lt;DIV style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt; &lt;/DIV&gt;&lt;DIV style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/DIV&gt;&lt;DIV style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/DIV&gt;&lt;DIV style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2018 02:37:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5406-external-pin-interrupt-starts-ADC-conversion-issue/m-p/728019#M29453</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2018-04-16T02:37:17Z</dc:date>
    </item>
  </channel>
</rss>

