ADC intput pin's voltage changed

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

ADC intput pin's voltage changed

跳至解决方案
830 次查看
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 项奖励
回复
1 解答
772 次查看
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 项奖励
回复
5 回复数
785 次查看
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 项奖励
回复
773 次查看
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 项奖励
回复
767 次查看
Kaitochi
Contributor I

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

0 项奖励
回复
778 次查看
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 项奖励
回复
793 次查看
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 项奖励
回复