Keil Logo Arm Logo

Discussion Forum

LPC1768 ADC gives more value often

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Lingaraju CH
Posted
21-May-2012 12:29 GMT
Toolset
ARM
New! LPC1768 ADC gives more value often

Hi all,

I am using LPC1768 for our custom board.
ADC is main functionality for our requirement. I have given regulated 3.3V for VDDA and Vrefp and provided 0.1uF ceramic X7F capacitors as bypass capacitors.
I have amplifiers and Low pass filters in line with the input.
When measured there is no noise as such (only 15mV max) in supply and grounds.
My input voltage is 2V. When read, the ADC is giving the correct with accuracy.
But often the voltage read is coming more than 3V.
I have tried with different ADC clocks from 1MHz to 6MHz. The problem is not resolved.
Please check the code given below.
My code is developed using keil RL-ARM RTOS.
Please help me to resolve this problem.

#define ADC_Control 0x00200800 //ADC Initialised with 1MHz clock, Power Enabled
U32 ADC_Read(U32 channel)
{
        U32 temp_adc_done=0, temp_adc_data=0 ;
        if(( 0 <= channel) && (7 >= channel))
        {
                LPC_ADC -> ADCR = ADC_Control | (1 << channel);

                LPC_ADC -> ADCR |= ADC_STACONV;      //ADC conversion start

                while(!((temp_adc_done = LPC_ADC -> ADGDR)& ADC_Done))

                temp_adc_data = LPC_ADC -> ADGDR; //Read the Converted data
                temp_adc_data = (temp_adc_data >> 4) & 0x00000FFF;//Right shifted by 4 since the data is from bits 15:4 bits
                return temp_adc_data;  //return the digital value
        }
        else
                return 0;  //Return 0
}
Read-Only
Author
jrzs ssrs
Posted
28-May-2012 04:00 GMT
Toolset
ARM
New! RE: LPC1768 ADC gives more value often

What do you mean by "But often the voltage read is coming more than 3V"? When the read out value indicate voltage more than 3V, how about the actual voltage(Using equipment to measure the voltage)?

Read-Only
Author
Lingaraju CH
Posted
28-May-2012 06:22 GMT
Toolset
ARM
New! RE: LPC1768 ADC gives more value often

Hi,
Sorry, that sentence is wrongly interpreted. Read it as "When mesaured, all signals voltage levels are ok i.e. they are above 3V for signal level high".

please suggest the solution.

regards
Lingaraju

Read-Only
Author
jrzs ssrs
Posted
28-May-2012 07:57 GMT
Toolset
ARM
New! RE: LPC1768 ADC gives more value often

Do you mean when you measured using equipment(Multimeter), you get 3.3V(Or above 3V); but when you read ADC, you get 2V?

How do you process the ADC value, or in other words, how do you calculate the voltage value using the ADC read out data?

Read-Only
Author
Lingaraju CH
Posted
28-May-2012 10:15 GMT
Toolset
ARM
New! RE: LPC1768 ADC gives more value often

Hi,

Thanks for the reply.

Analog Input signal to the ADC is 2V when measured using Multimeter and Digital Oscilloscope. It is same staring from the input of the amplifier to the output of the filter i.e the input of the ADC input channel. ADC is also giving the digital value equivalent to 2V. But some times it is giving digital values which are equivalent to more than 3V.

My question is, eventhough there is no noise in the analog input channels, supply and ground, why ADC gives such a wrong digital value sometimes.

regards
Lingaraju

Read-Only
Author
jrzs ssrs
Posted
29-May-2012 09:06 GMT
Toolset
ARM
New! RE: LPC1768 ADC gives more value often

Sounds to me this problem is not firmware problem but hardware unstable problem.

"But some times it is giving digital values which are equivalent to more than 3V."
How long the "more than 3V" last? When the ADC gives values equivalent to more than 3V, what is the voltage measured by Multimeter?

My question is, eventhough there is no noise in the analog input channels, supply and ground,
Just as I mentioned above, how can you confirm there is no noise? The "more than 3V" last how long? Can you use oscilloscope to capture what is happening when the ADC gives values equivalent to more than 3V?

Read-Only
Author
Per Westermark
Posted
29-May-2012 10:01 GMT
Toolset
ARM
New! RE: LPC1768 ADC gives more value often

Note that the ADC measures relative to a reference voltage. So if that reference voltage makes a dip, the ADC reading will show a too high value. Are your input signal always lower than VDDA? Are your input signal always inside VREFN and VREFP?

Next thing is that there is a potential that a short, but high, voltage spike could result in a latchup of the input, which can result in high readings.

Read-Only
Author
Lingaraju CH
Posted
29-May-2012 10:11 GMT
Toolset
ARM
New! RE: LPC1768 ADC gives more value often

Hi,

My firmaware is starting ADC conversion once for every 10 mSec. After about 5 Secs or 10Secs, I am observing this error. At that time I have checked using oscilloscope, it shows 2V only. As I have already mentioned there is nothing mentionable noise observed (it is only 15mV).

regards
Lingaraju

Read-Only
Author
Per Westermark
Posted
29-May-2012 10:33 GMT
Toolset
ARM
New! RE: LPC1768 ADC gives more value often

But have you looked at all signals? Is ground stable? Is VDDA stable? What sampling rate on the scope - fast enough to catch a short spike?

Read-Only
Author
erik malund
Posted
29-May-2012 13:51 GMT
Toolset
ARM
New! clear as mud

My firmaware is starting ADC conversion once for every 10 mSec. After about 5 Secs or 10Secs, I am observing this error.
do you, after some seconds get a 'blip' (one or two wrong readings) or ar all readings thereafter wrong?

if it is a 'blip' does it repeat and how frequently, is the time between blip 1 and blip 2 about the same as the time between blip 2 and blip 3? do some statistics on blip intervals.

Erik

Read-Only
Author
Lingaraju CH
Posted
29-May-2012 15:14 GMT
Toolset
ARM
New! RE: clear as mud

Hi,

I am using a 200MHz oscilloscope. the time interval between the blips is not linear, some times it is 5 Secs and sometimes it is around 1 minute.

regards
Lingaraju

Read-Only
Author
erik malund
Posted
29-May-2012 15:57 GMT
Toolset
ARM
New! RE: clear as mud

ok, so it is blips.
just to lead you on your way I have had a case of enormous blips when an elevator in the building started.
if you have the possibility to temporarily change to battery power that would be a great diagnostic

Erik

Read-Only
Author
Jim Earle
Posted
30-May-2012 16:25 GMT
Toolset
ARM
New! RE: LPC1768 ADC gives more value often

Try removing the bypass capacitor. This type of ADC does not tolerate much input capacitance. The spec is 15pf (max).

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.