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