10 years, 5 months ago.

Analog Input Precision

If I use an analog input and the function read_u16() the value I get are normalized to 16 bit but the ADC is 12 bit. This means the ADC result is shifted 4 times to the left. Than the least significand nibble should be 0. ( for input of 1/2 of reference 7FF0 to 8000. But this is not the case. A good methode would be to have 16 conversions summed. but this is also not the case.

As an example of multiple conversions with a stable input this are the results: 7F87, 7F17, 7F47, 7F97, 80A8, ...:

On my mind the last digit ( xxx7 in the example) has no meaning and is a copy of the first digit , but where is coming from?? The ADC conversion noise is quite high becaue of running cpu on the same chip. but than you have a precision of 9 bit at a resolution of 12 bit.

Thanks for any ressponse

1 Answer

10 years, 5 months ago.

The last digit is indeed a copy of the first one. That way it can reach between 0x0000 and 0xFFFF, without getting in weird steps in the output.

On the mbed LPC1768 the analog and digital power supplies aren't well isolated (probably also hard on a small board), which limits the accuracy. That said it should be able to get it alot cleaner than that afaik. Make sure your input is indeed stable, it doesn't have a high capacitance or output resistance of the driving circuit on it (something like a few pF and 7.5kOhm iirc, but it is in the LPC1768s datasheet), and make sure there is no other switching nearby (PWM, SPI, etc). Also setting pins around it to DigitalOut, and then either VDD, or probably preferably GND, can reduce the noise.

Accepted Answer