FRDM-K22F 16bit single ADC, can't sample the >1.65V  voltage

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

FRDM-K22F 16bit single ADC, can't sample the >1.65V  voltage

Jump to solution
960 Views
kentgu
Contributor III

hi,

I am a newer for kinetis chip.

Now I try " xx\freescale\KSDK_1.3.0\examples\frdm22f\driver_examples\adc16" example, I do like the below steps:

     #1, Remove the R23, and connect DC voltage source to J24.1 "ADC0_DP0"

     #2, Use "chnConfig.chIdx = (adc16_chn_t)kAdc16chn0" to select ADC channel

 

Now I can read the correct voltage when DC voltage source is < 1.65V, but for the voltage >1.65V, I can't correct the voltage. The questions is that the ADC input voltage is 0~3.3V because Vrefh is 3.3V? If yes, how I can read >1.65V voltage when ADC module work on 16bit ADC signal mode?

 

Thanks!

Kent

Labels (1)
0 Kudos
Reply
1 Solution
713 Views
kentgu
Contributor III

Hi,XiaoJun

Thanks a lot for your reply and trial. It si very helpful.

I don't why, now I get the correct result when the voltage >1.65V. Such as 1.701V  get 33824 data.Don't need reverse data. It is strage, same voltage input( DIFF_ADC0_DP(pin1 of J24) to 1.70V, GND-12 connect Ground).

TSK~

Kent

View solution in original post

0 Kudos
Reply
3 Replies
713 Views
kentgu
Contributor III

Hi, XiaoJun

You are right. The origin source code use "ADC_DRV_GetCovValueSingned()", it jus get can Max 0x7FFF data, which is singed. But if we use " ADC_DRV_GetCovValueRAW()", we can get Max 0xFFFF data.

Have a good day.

Kent

0 Kudos
Reply
713 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Kent,

Regarding your question that the ADC16 can not give correct result when you run the example:" xx\freescale\KSDK_1.3.0\examples\frdm22f\driver_examples\adc16" with only the line modification:

void ADC16_Measure(void)

{

    adc16_chn_config_t chnConfig;

    // Configure the conversion channel

    // differential and interrupt mode disable.

    chnConfig.chnIdx     = (adc16_chn_t)kAdc16Chn0; //ADC16_TEMPERATURE_CHN;

.................

}

I have tested it, I get correct result. When I connect the DIFF_ADC0_DP(pin1 of J24) to GND, the result from screen:

"

press any key to start measure temperature

ADC converted value: 2

Temperature 466

"

When I connect the DIFF_ADC0_DP(pin1 of J24) to 3.3V, the result from screen:

"

press any key to start measure temperature

ADC converted value: -8

Temperature 467

"

The ADC result register is 0xFFF5, it menas that "-8" is 0xFFF5, because you use 16 bits ADC resolution.

From the phenomenon, when the tested voltage is less than 1.65V, the ADC result will be 0x7FFF, which is the maximum value for a fractional data format. When the voltage is greater than 1.65V, the ADC result will be greater than 0x7FFF, which will show a negative value. The actual value will be 0xFFFF- the negative value.

Hope it can help you

BR

XiangJun Rong

714 Views
kentgu
Contributor III

Hi,XiaoJun

Thanks a lot for your reply and trial. It si very helpful.

I don't why, now I get the correct result when the voltage >1.65V. Such as 1.701V  get 33824 data.Don't need reverse data. It is strage, same voltage input( DIFF_ADC0_DP(pin1 of J24) to 1.70V, GND-12 connect Ground).

TSK~

Kent

0 Kudos
Reply