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);
}
Solved! Go to Solution.
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.
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
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.
Thanks for your support. I have combined both ways and it works fine
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?
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