<?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: 16bit differential adc config in MCX Microcontrollers</title>
    <link>https://community.nxp.com/t5/MCX-Microcontrollers/16bit-differential-adc-config/m-p/1876747#M392</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/233053"&gt;@Dirk3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check below settings.&lt;/P&gt;
&lt;P&gt;1&amp;gt; Use oscilloscope confirm there is input signal in ADC channel of your board.&lt;/P&gt;
&lt;P&gt;2&amp;gt;Config ADC input pin correctly.&lt;/P&gt;
&lt;P&gt;3&amp;gt;Enabled clock.&lt;/P&gt;
&lt;P&gt;4&amp;gt;Using ADC demo under SDK to test firstly, whether can work without any issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2024 03:18:10 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2024-05-29T03:18:10Z</dc:date>
    <item>
      <title>16bit differential adc config</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/16bit-differential-adc-config/m-p/1870781#M366</link>
      <description>&lt;P&gt;I want to use the 16bit differential ADC on the FRDM MCXN947 dev board. I cannot get the configuration correct. See the screenshots attached to see the configuration in Config Tools. My main code is added as code sample, could someone help me figure out why I cannot get a result from the ADC.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/*
 * Copyright 2016-2024 NXP
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

/**
 * @file    ADC_test4.c
 * @brief   Application entry point.
 */
#include &amp;lt;stdio.h&amp;gt;
#include "board.h"
#include "peripherals.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "MCXN947_cm33_core0.h"
#include "fsl_debug_console.h"
#include "fsl_lpadc.h"
#include "fsl_ctimer.h"
#include "fsl_spc.h"

/*******************************************************************************
 * Variables
 ******************************************************************************/
volatile uint32_t adcResult = 0U;
volatile bool g_LpadcConversionCompletedFlag = false;
lpadc_conv_result_t convResult;

/*******************************************************************************
 * Definitions
 ******************************************************************************/

/* ADC IRQ handler */
void ADC0_IRQHandler(void) {
    PRINTF("ADC0 interrupt triggered\n");
    #if (defined(FSL_FEATURE_LPADC_FIFO_COUNT) &amp;amp;&amp;amp; (FSL_FEATURE_LPADC_FIFO_COUNT == 2U))
        if (LPADC_GetConvResult(ADC0, &amp;amp;convResult, 0U))
    #else
        if (LPADC_GetConvResult(ADC0, &amp;amp;convResult))
    #endif /* FSL_FEATURE_LPADC_FIFO_COUNT */
    {
        g_LpadcConversionCompletedFlag = true;
    }
    SDK_ISR_EXIT_BARRIER;
}



/*!
 * @brief Main function
 */
int main(void) {

    /* Init board hardware. */
    SPC_EnableActiveModeAnalogModules(SPC0, kSPC_controlVref);
    BOARD_InitBootPins();
    BOARD_InitBootClocks();
    BOARD_InitBootPeripherals();
    BOARD_InitDebugConsole();


    /* Enable interrupts for ADC0 */
    LPADC_EnableInterrupts(ADC0, kLPADC_Trigger0CompletionInterruptEnable | kLPADC_FIFO0WatermarkInterruptEnable);
    EnableIRQ(ADC0_IRQn);

    PRINTF("Please input any character to get the ADC result\r\n");
    while (1) {

        GETCHAR();
        LPADC_DoSoftwareTrigger(ADC0, 1U);
        while(!g_LpadcConversionCompletedFlag) {
        }
        PRINTF("ADC Result: %d\n", convResult.convValue);
        g_LpadcConversionCompletedFlag = false;
    
        }

    return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dirk3_0-1716381764699.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/280197iAEB2923A2AE0D781/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dirk3_0-1716381764699.png" alt="Dirk3_0-1716381764699.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dirk3_1-1716381781776.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/280199iBB21150C93EDC09C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dirk3_1-1716381781776.png" alt="Dirk3_1-1716381781776.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="Dirk3_2-1716381805379.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/280200i1948C7418C535AB2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dirk3_2-1716381805379.png" alt="Dirk3_2-1716381805379.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 12:49:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/16bit-differential-adc-config/m-p/1870781#M366</guid>
      <dc:creator>Dirk3</dc:creator>
      <dc:date>2024-05-22T12:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: 16bit differential adc config</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/16bit-differential-adc-config/m-p/1876747#M392</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/233053"&gt;@Dirk3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check below settings.&lt;/P&gt;
&lt;P&gt;1&amp;gt; Use oscilloscope confirm there is input signal in ADC channel of your board.&lt;/P&gt;
&lt;P&gt;2&amp;gt;Config ADC input pin correctly.&lt;/P&gt;
&lt;P&gt;3&amp;gt;Enabled clock.&lt;/P&gt;
&lt;P&gt;4&amp;gt;Using ADC demo under SDK to test firstly, whether can work without any issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 03:18:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/16bit-differential-adc-config/m-p/1876747#M392</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2024-05-29T03:18:10Z</dc:date>
    </item>
  </channel>
</rss>

