ADC range short of voltage reference high

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

ADC range short of voltage reference high

Jump to solution
833 Views
rickstuart
Contributor V

HI,

I've a KL17 QFN32 processor who's ADC appears to have a voltage range of about 1/6th of the expected 0 to 3 volts.  3 volts is what can be measured at the Voltage Reference High pin.

The setup is to convert the ADC input into a 12 bit output using the Voltage Reference High and Low pins (8 and 7 on this package).  This is done by setting the ADC0_CFG1 register MODE bits to 0b01.  (i.e. "ADC0_CFG1 |= ADC_CFG1_MODE(1);").  But not until I run the voltage at the analog input pin down to ~500mV does the ADC start reducing it's value from the pegged 4095.  When I finally hit 0 volts the ADC is giving me values in the 40s and 50s.

What I was expecting were changes in the values from 0 volts all the way up to 3 volts.  For example, 0 volts would have an ADC value of about zero and 1.5 volts would have an ADC value of about 2048 and 3 volts would have an ADC value of about 4096.

Any ideas on what I might check would be appreciated.

-thanks

Labels (2)
0 Kudos
1 Solution
492 Views
rickstuart
Contributor V

Found the answer:  This code was ported from a larger pin count processor.   The tricky bit was that the default ADC reference selection behavior changes when you go from large pin count processor packages to small pin count processor packages.**  For example, if you were using voltage-high-ref and voltage-low-ref on a large pin count processor package, your code would now be using internal-voltage-ref on a small pin count processor package.  I was surprised when I finally figured this out.

Note: You do have to be careful when using the Freescale specifications.  The section which talks about setting the bits to select an ADC reference only uses the terms Default and Alternate.  These terms abstract the fact that Default means different things on different sized pin count packages.

View solution in original post

0 Kudos
1 Reply
493 Views
rickstuart
Contributor V

Found the answer:  This code was ported from a larger pin count processor.   The tricky bit was that the default ADC reference selection behavior changes when you go from large pin count processor packages to small pin count processor packages.**  For example, if you were using voltage-high-ref and voltage-low-ref on a large pin count processor package, your code would now be using internal-voltage-ref on a small pin count processor package.  I was surprised when I finally figured this out.

Note: You do have to be careful when using the Freescale specifications.  The section which talks about setting the bits to select an ADC reference only uses the terms Default and Alternate.  These terms abstract the fact that Default means different things on different sized pin count packages.

0 Kudos