ADC intput pin's voltage changed

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADC intput pin's voltage changed

Jump to solution
434 Views
Kaitochi
Contributor I

Hi NXP, 

I'm using ADC in LPC54102J512 microcontroller. After executing the function ADC_DoSelfCalibration() specifically this command line: base->STARTUP = ADC_STARTUP_ADC_ENA_MASK; tthen my ADC input pin's voltage changed from 1.7V to 3.5V. How to solve this problem. Here is my code config ADC:

static void ADC0_init(void) {
/* Perform self calibration */
ADC_DoSelfCalibration(ADC0_PERIPHERAL);
/* Initialize ADC0 peripheral */
ADC_Init(ADC0_PERIPHERAL, &ADC0configStruct);
/* Configure the conversion sequence A */
ADC_SetConvSeqAConfig(ADC0_PERIPHERAL, &ADC0ConvSeqAConfigStruct);
/* Enable the conversion sequence A */
ADC_EnableConvSeqA(ADC0_PERIPHERAL, true);
/* Configure threshold compare interrupt on channel 10 */
ADC_EnableThresholdCompareInterrupt(ADC0_PERIPHERAL, 8U, kADC_ThresholdInterruptDisabled);
ADC_EnableThresholdCompareInterrupt(ADC0_PERIPHERAL, 9U, kADC_ThresholdInterruptDisabled);
ADC_EnableThresholdCompareInterrupt(ADC0_PERIPHERAL, 10U, kADC_ThresholdInterruptDisabled);
}

0 Kudos
1 Solution
376 Views
frank_m
Senior Contributor III

You must provide either a low enough input impedance at your ADC inputs, or increase sampling time / inner-sample delays.

All ADC inputs configured for a conversion sequence are connected to the same internal Sample&Hold capacitor in rapid succession (and then converted). If the input does not provide enough current to charge/discharge this S&H capacitor in the specified time, you get exactly this channel "crosstalk" effect.

You can view the ADC as a simple RC element in this regard.

 

View solution in original post

0 Kudos
5 Replies
389 Views
Kaitochi
Contributor I

It is connected. I'm reading 3 channels 8, 9, 10 of ADC0. If 2 channels 9, 10 are not connected to the board, channel 8 channel 8 reads the correct result

0 Kudos
377 Views
frank_m
Senior Contributor III

You must provide either a low enough input impedance at your ADC inputs, or increase sampling time / inner-sample delays.

All ADC inputs configured for a conversion sequence are connected to the same internal Sample&Hold capacitor in rapid succession (and then converted). If the input does not provide enough current to charge/discharge this S&H capacitor in the specified time, you get exactly this channel "crosstalk" effect.

You can view the ADC as a simple RC element in this regard.

 

0 Kudos
371 Views
Kaitochi
Contributor I

Thanks for your support. I have combined both ways and it works fine

0 Kudos
382 Views
scottm
Senior Contributor II

I haven't used the comparator function myself so I can't speak to that. When you say the voltage changes after starting the ADC, do you mean that the voltage measured externally (with a voltmeter or oscilloscope) is changing? What is the source impedance for the signal?

0 Kudos
397 Views
scottm
Senior Contributor II

Is this happening with nothing connected?

If the pin defaults to output mode as a GPIO then I'd expect the voltage to change once you switch the pin to ADC input mode.

Scott

0 Kudos