Unexpected ADC value shift

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unexpected ADC value shift

1,827 Views
zingae
Contributor II

I have an analog input circuit in the form of a resistor divider that does not change quickly, so for arguments sake it is a DC circuit. The user-installed off-board resistance can be anywhere from 300 Ω to 14 kΩ for a sensor.

I see strange behavior on a new board design (iMXRT2014) compared to the same EXACT circuit on a previous board design using the Kinetis K60. The strange behavior is a larger than expected shift in the ADC reading when reaching a certain resistance/ADC input voltage.

I am simulating different resistance values for the off-board resistor using an Arduino controlling a digital potentiometer (Rtest in the schematic below). I used a voltmeter to measure the voltage drop at the off-board resistor to validate that what I am seeing is related to the circuit and not something to do with the ADC or ADC Ref. For a sanity check, I even removed the TVS diodes and resistor, but no change in behavior.

I tried multiple modifications to the analog input circuit and even the ADC VRef but cannot get rid of the ADC value shift. I will explain each thing I tried further down.

-----

SETUP #1
Original circuit with the following other electrical info. All other mentioned setups will have the same parameters unless otherwise specified.

* VDD = NVCC_GPIO = 3.3V
* VDDA_ADC_3P3 (i assume this is VDDA?) = 3.0V
* VDD_SOIC_IN = 1.2V (external LDO, not internal buck regulator)
* ADHSC = 0 & ADLPC = 0 (but i also tried other combinations with no luck)
* When Rtest = 0 Ω, Ain at MCU is 3.18V which is within the datasheet specs. And I assume that a voltage larger than VAref would just yield an ADC value of all F's (0x0FFF)

sch.png

 

power.PNG

Here is a printout of the ADC values as the potentiometer increases/decreases. You will notice the unexpected shift in ADC values occurs at different points depending on whether resistance is counting up or down.

adc_print.png

The plot below shows the ADC values as the potentiometer starts at 1 Ω and increases to 20 kΩ in single-count steps (x-axis) compared to the ADC value (y-axis). The dark blue line is the previous K60 board's behavior where you see a clean curve. The light-blue line is the new iMXRT1024 board design where you can see a sudden drop in the ADC-value curve (circled in red). The drop in the chart corresponds to Rtest being ~2.5 kΩ.

chart.png

Seperate strange observation that I can't explain is that if I jumper the input terminals I2 & G2 together (current path skips over the off-board resistor) and then un-jumper them, the ADC value goes back to what I would expect. If I power cycle the board, the voltage returns to the higher value until I jumper the terminals again. The change in voltage drop at the off-board resistor before and after shorting I2 & G2 is ~200 mV.

Aside from the unexpected shift in ADC values, can this change in voltage drop measurement before and after jumpering be explained?

-----

SETUP #2
I changed R14 (619R) to be a 1KΩ resistor. This got rid of the change in voltage drop reading before and after jumpering, but it did not get rid of the shift in ADC values. It did however change the ADC value's shift-point to 1.7KΩ off-board resistance.

-----

SETUP #3
I noticed this in the datasheet, so i tried making VDDA_ADC_3P3 = 3.3V (I assume this is VDDA?), but this still did not correct the ADC shift behavior.

datasheet.png

-----

SETUP #4
Leaving R14 as 1KΩ, I changed R20 from 4.7KΩ to 1KΩ to increase current to Ain pin and this reduced the size of the ADC-value shift from 45 ADC counts to 10 ADC counts, which is a step in the right direction, but does not solve the problem. It makes me wonder though, what is the minumum amount of current that needs to flow to the analog input? When I made this change, VAin = 2.61V when Rtest = 0Ω

-----

I am looking for an explanation/understanding of this behavior rather than just playing with the voltage divider until it works as expected.

Am I missing an MCU setting somewhere that may effect this?

Thanks in advance for any help!

Labels (1)
Tags (2)
3 Replies

1,819 Views
lucas_cao
NXP Employee
NXP Employee

Hi 

I have an idea here.

Please check your pad settings.

For ADC input, you should configure the pad without any pull-up/pull-down or keeper.

1,806 Views
zingae
Contributor II


thank you! the keeper was enabled by default...which is an odd default setting to me. Disabling it fixed it

Follow up question....

Can you explain that datasheet snippet about "Delta to VDD"? Is VDDA and VDDA_ADC_3P3 the same thing? Everything appears to work as expected (now that keeper is disabled) with VDDA_ADV_3P3 = 3.0V
0 Kudos
Reply

1,796 Views
lucas_cao
NXP Employee
NXP Employee

Hi

Glad to see it can work well. I met your ADC value shift before, so i know the root cause.

But for your new question, I cannot help here. You can create a new thread for your new question.

 

0 Kudos
Reply