Hi,
I am trying to get the ADC working on the LPC5504. I have working test code right now that seems to produce reasonable results when using standard resolution mode. I will include my code below.
I am trying to get a reading of the voltage on PIO1_0/ADC0_11 relative to VDD.
I have a multimeter and I am measuring 2.58v on that pin with VDD being a solid 3.32v. When in standard resolution, I get back an ADC reading of around 3200. This corresponds to a voltage of 2.59v which is quite accurate.
However, if I simply change from using:
cmd.conversionResolutionMode = kLPADC_ConversionResolutionStandard;
to:
cmd.conversionResolutionMode = kLPADC_ConversionResolutionHigh;
I now get a reading of ~6400 back from the ADC. This is exactly twice the value I get in low resolution mode.
According to all of the documentation I can find, in high resolution single side mode I should be getting a value that ranges from 0-65535. If I interpret this 6400 value on this scale, it equates to just .32v, which is absurd.
Why does changing to high resolution mode simply give a result that is twice the magnitude of standard resolution? Am I missing something else that I need to do in order to change modes?
While things seem to be working OK in standard mode, this issue makes me uneasy about everything I am doing with the ADC. I want to understand what is going on to make sure I am not just getting back garbage results which happen to correspond to what I expect to see in standard resolution mode.
I have attached the C file I am using to control the ADC. I am calling ADC_Init and then polling ADC_ReadRaw in my application's update loop. The values I am examining are the ones returned from ADC_ReadRaw.
Thanks.