Seemingly broken behavior of LPC5504's ADC in high resolution mode

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Seemingly broken behavior of LPC5504's ADC in high resolution mode

266件の閲覧回数
dlayne_i2
Contributor I

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.

0 件の賞賛
返信
1 返信

181件の閲覧回数
Pablo_Ramos
NXP Employee
NXP Employee

Hi @dlayne_i2,

Did you make any other changes to the code besides the change to the conversion resolution?

Could you help me verify if the problem still persists after making these changes?

Using channel A of the ADC
Increasing the sample time

Also, there is an example for the LPC55S06 (lpadc_polling) that configures the ADC with high resolution. If you use the same configuration, is the conversion still incorrect?

0 件の賞賛
返信