Hi,
In the SDK package, there is an ADC example called lpc_adc_interrupt, I developed the code based on the example so that you can sample ADC_7 channel which is PIO0_19 pin.

I changed the pin_mux.c with the code:
void BOARD_InitPins(void)
{
/* Enables clock for IOCON.: enable */
CLOCK_EnableClock(kCLOCK_Iocon);
/* Enables clock for switch matrix.: enable */
CLOCK_EnableClock(kCLOCK_Swm);
const uint32_t IOCON_INDEX_PIO0_7_config = (/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Enable hysteresis */
IOCON_PIO_HYS_EN |
/* Input not invert */
IOCON_PIO_INV_DI |
/* Disables Open-drain function */
IOCON_PIO_OD_DI |
/* Bypass input filter */
IOCON_PIO_SMODE_BYPASS |
/* IOCONCLKDIV0 */
IOCON_PIO_CLKDIV0);
/* PIO0 PIN7 (coords: 45) is configured as ADC0, CH, 0. */
IOCON_PinMuxSet(IOCON, IOCON_INDEX_PIO0_7, IOCON_INDEX_PIO0_7_config);
////////////////////////ADC_7 PIO0_19
const uint32_t IOCON_INDEX_PIO0_19_config = (/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Enable hysteresis */
IOCON_PIO_HYS_EN |
/* Input not invert */
IOCON_PIO_INV_DI |
/* Disables Open-drain function */
IOCON_PIO_OD_DI |
/* Bypass input filter */
IOCON_PIO_SMODE_BYPASS |
/* IOCONCLKDIV0 */
IOCON_PIO_CLKDIV0);
/* PIO0 PIN7 (coords: 45) is configured as ADC0, CH, 0. */
IOCON_PinMuxSet(IOCON, IOCON_INDEX_PIO0_19, IOCON_INDEX_PIO0_19_config);
//////////////////////////
const uint32_t IOCON_INDEX_PIO1_16_config = (/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Enable hysteresis */
IOCON_PIO_HYS_EN |
/* Input not invert */
IOCON_PIO_INV_DI |
/* Disables Open-drain function */
IOCON_PIO_OD_DI |
/* Bypass input filter */
IOCON_PIO_SMODE_BYPASS |
/* IOCONCLKDIV0 */
IOCON_PIO_CLKDIV0);
/* PIO1 PIN16 (coords: 36) is configured as USART0, RXD. */
IOCON_PinMuxSet(IOCON, IOCON_INDEX_PIO1_16, IOCON_INDEX_PIO1_16_config);
const uint32_t IOCON_INDEX_PIO1_17_config = (/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Enable hysteresis */
IOCON_PIO_HYS_EN |
/* Input not invert */
IOCON_PIO_INV_DI |
/* Disables Open-drain function */
IOCON_PIO_OD_DI |
/* Bypass input filter */
IOCON_PIO_SMODE_BYPASS |
/* IOCONCLKDIV0 */
IOCON_PIO_CLKDIV0);
/* PIO1 PIN17 (coords: 37) is configured as USART0, TXD. */
IOCON_PinMuxSet(IOCON, IOCON_INDEX_PIO1_17, IOCON_INDEX_PIO1_17_config);
/* USART0_TXD connect to P1_17 */
SWM_SetMovablePinSelect(SWM0, kSWM_USART0_TXD, kSWM_PortPin_P1_17);
/* USART0_RXD connect to P1_16 */
SWM_SetMovablePinSelect(SWM0, kSWM_USART0_RXD, kSWM_PortPin_P1_16);
/* ADC_CHN0 connect to P0_7 */
SWM_SetFixedPinSelect(SWM0, kSWM_ADC_CHN0, true);
//////////////////////
/* ADC_CHN0 connect to P0_7 */
SWM_SetFixedPinSelect(SWM0, kSWM_ADC_CHN7, true);
//////////////////////
/* Disable clock for switch matrix. */
CLOCK_DisableClock(kCLOCK_Swm);
}
In the main(), I only changed the channel
//#define DEMO_ADC_SAMPLE_CHANNEL_NUMBER 0U
#define DEMO_ADC_SAMPLE_CHANNEL_NUMBER 7U
From the
Pls have a try console, the ADC result is correct.
Hope it can help you
BR
XiangJun Rong