This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

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
}

Parents
  • 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?

Reply
  • 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?

Children