ADC reading problem in LPC54628

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

ADC reading problem in LPC54628

3,353 Views
nitin_kanani
Contributor II

Hello Team,

i have ADC driver version 2.3.1. 

I used ADC0 channel number 4 and 5

if i changed value of channel 4 using potentiometer that is affect channel number 5

so i didnot getting actual result of  channel number 5.

i attached source code. so plz review it.

let me know if any solution for that.

Thanks and best regards,

Nitin

 

Labels (3)
13 Replies

2,573 Views
nitin_kanani
Contributor II

Hi ,

Thanks for reply.

I used  OM13098: LPCXpresso54628 Development Board.

1)I give 3.3v and ground from the above board. output pin of potentiometer which is connected ADC0 channel no 4.
and ADC0 channel i give ground.

ISSUE: when i changing value of potentiometer, ADC0 channel 5 also change.

3)i got approx 100 to 400 count variation 

 

if possible then perform other test also which is i mentioned in below.

=>provide fix 1v  to AD0 channel 5  then change input of channel 4.

its give approx 300 count variation in channel 5.

Thank You 

Nitin Kanani

0 Kudos

2,573 Views
nxf51211
NXP Employee
NXP Employee

Hi,

Based on what you've described me, I did a new experiment where I provided 1.0 V to one channel (through an external voltage source) while I provided the other with a voltage of 3.3 V (from the board itself) divided with a potentiometer. In the following images you can see the results I got and the connections I did to my board:

pastedImage_3.png

pastedImage_5.png

As you can see, I'm still getting small variations on the constant input of 1.0 V and the accuracy error is minimal. I did the previous experiments with the same code you uploaded and enabling Bypass Calibration and sampleTimeNumber to 7U.

After this last experiment, I'm still not sure of what could be the cause of your problem. Would it be possible for you to show a picture of the connections you have on your board?

Best Regards,

Ricardo Delsordo

0 Kudos

2,573 Views
nitin_kanani
Contributor II

Hi,

thanks for your quick reply.

i attached my connection and ADC reading log. plz see it.

my sensor o/p is 0 to 10v. that o/p is give to voltage divider. its generate 0 to 3.3v according sensor o/p(0 to 10v). that 0 to 3.3v i gave in AD0_CH4.

In ADC0_CH5 connected approx 1v(from POT).

ISSUE: if my sensor o/p is change.it is affect in AD0_CH5 count.

I attached ADC count reading log.

Thank You

Nitin Kanani

IMG_20190723_115956.jpg

0 Kudos

2,573 Views
nxf51211
NXP Employee
NXP Employee

Hi,

What Rainald says could explain why you are getting so much noise on your ADC readings. You can also try and change the voltage divider made with resistors for an OpAmp configuration that lowers your voltage to a maximum of 3.3 V (this would solve any problems caused by impedance).

Best Regards,

Ricardo Delsordo

2,573 Views
rainald_koch
Contributor II

Hi Nitin,

what are the resistor values of the voltage divider at the origin of the orange wire?

If the impedance of that point is too high, its potential is influenced via the capacity between the multiplexer and the ADC leading to crosstalk from the channel sampled before.

You may want to test whether this is the disturbing mechanism by sampling CH_5 twice. I expect the second result being less affected by the voltage at CH_1.

Regards,

Rainald

2,573 Views
nitin_kanani
Contributor II

Hi,

I attached revised image.which have value of resistor.

please see it.

Thank You,

Nitin

IMG_20190723_115956.jpg

0 Kudos

2,573 Views
rainald_koch
Contributor II

300 count variation is a lot.

I'm running out of ideas, last try: Ground means ADC GND? (Should not be that much different on a development board)

0 Kudos

2,573 Views
nxf51211
NXP Employee
NXP Employee

Hi,

It is possible that your issue is caused by the fact that the readings between both channels is too fast that it affects the other channel's readings, or that the LPC suffers from cross talk interference on its pins. In order to minimize this issue, you can enable Bypass Calibration to true, and increase the Sample Time Number (I increase it to 13).

The Bypass calibration is just for re-calibration of the ADC, and the Sample Time Number provides more the time between adc readings and thus allows the reduction of the noise in your adc values.

static void ADC_Configuration(void)
{
    adc_config_t adcConfigStruct;
    adc_conv_seq_config_t adcConvSeqConfigStruct;

.
.
.

#if defined(FSL_FEATURE_ADC_HAS_CTRL_BYPASSCAL) & FSL_FEATURE_ADC_HAS_CTRL_BYPASSCAL
    adcConfigStruct.enableBypassCalibration = true;
#endif /* FSL_FEATURE_ADC_HAS_CTRL_BYPASSCAL */
#if defined(FSL_FEATURE_ADC_HAS_CTRL_TSAMP) & FSL_FEATURE_ADC_HAS_CTRL_TSAMP
    adcConfigStruct.sampleTimeNumber = 13U;
.
.
.
}

Here is a description of why a cross talk happens:

pastedImage_1.png

Best Regards,

Ricardo Delsordo

ATTACHMENTS

0 Kudos

2,573 Views
nitin_kanani
Contributor II

Hi Ricardo Delsordo,

Thanks for quick reply.

I have checked based on your input.I have modified "enable Bypass Calibration to true, and increase the Sample Time Number (I increase it to 13)".

Because Sample Time Number has only three bits. I have checked for value 6Bypass Calibration to true is also done.

Still I am not getting expected result.

ADC value still affecting other channel.

kindly let me know other feedback on this.

Thank You, 

Nitin Kanani

0 Kudos

2,573 Views
nxf51211
NXP Employee
NXP Employee

Hi,

I would like to ask the following questions so I can get a better understanding of your current situation:

1) What is the maximum voltage level you are inserting to your ADC inputs? (The one you are modifying with the potentiometer).

2) Where did you see that the sampleTimeNumber argument has only three bits? (I checked on its structure and I've seen that is is delared at fsl_adc.h as type uint32_t)

3) Once you enabled the Bypass Calibration, and set the sampleTimeNumber to 6, did you see any improvement on the values read by the ADC channels?

Best Regards,

Ricardo Delsordo

0 Kudos

2,573 Views
nitin_kanani
Contributor II

Hi,

Thanks for your reply.

1)maximum input is 3.3v.

2)I attached image plz see that for sampleTimeNumber.

3)I enabled the Bypass Calibration thats give some improvement but not getting expected result in other channel.

adc_image.pngadc_ctrl.png

Thank You,

Nitin Kanani

0 Kudos

2,573 Views
nxf51211
NXP Employee
NXP Employee

Hi, 

1) Would it be possible for you to show me the hardware implementation you are using on your project (from your voltage source to your connections to the ADC pins including the potentiometer).

2) You are correct, sorry for my confusion on the number of bits for the sampleTimeNumber (I've changed the value to 7U or 3'b111 on my side for trying your code).

3) How big is the error on the accuracy of the readings you get on your ADC pins?

I've done some tests on my side (based on the project you shared, and enabling BypassCalibration and setting sampleTimeNumber to 7U) and the error I get is minimal (which is caused by the noise I mentioned on my first reply). In the following image I inserted 1.0 V to one ADC pin (that is equal to 1241 approx on the values you get from the LPC) and the other I connect it to GND; I then repeated the experiment but the other way around:

pastedImage_2.png

As you can see from the readings I got, the ADC value presents a small accuracy error. You can attempt to get better results if you calculate and average value from a certain amount of readings (ex: you can get the average ADC value for every 5 readings you get).

Best Regards,

Ricardo Delsordo

0 Kudos

2,573 Views
rainald_koch
Contributor II

Hi Nitin,

your Table 1026 mentions source impedance.

What is the source impedance of the signal connected to channel 5?

Regards, Rainald

0 Kudos