Hi guys,
I met a problem. I am trying to use NHS3152 to measure resistance.

R0 = 8200;
R = 3900;
VDD = 3300 mV
The strange thing is the resistance R = 3069.49, not 3900. The ADC value was 898.8 mV (Native value: 2301 ). Is there any problems of the ADC configuration and IOCON? I don't understand where the error is.
Code is :
- Init ADC
Chip_IOCON_SetPinConfig(NSS_IOCON, IOCON_ANA0_3, IOCON_FUNC_1); /* Set pin function to analog */
Chip_ADCDAC_Init(NSS_ADCDAC0);
Chip_ADCDAC_SetMuxADC(NSS_ADCDAC0, AN3);
Chip_ADCDAC_SetInputRangeADC(NSS_ADCDAC0, ADCDAC_INPUTRANGE_WIDE);
Chip_ADCDAC_SetModeADC(NSS_ADCDAC0, ADCDAC_SINGLE_SHOT);
- Get val
float res;
int vdd_input = 3300; //Input voltage
int r_0 = 8200; //Pull-up Resistor
Chip_ADCDAC_StartADC(NSS_ADCDAC0);
while (!(Chip_ADCDAC_ReadStatus(NSS_ADCDAC0) & ADCDAC_STATUS_ADC_DONE)) {
; /* Wait until measurement completes. For single-shot mode only! */
}
adcInput = ((float)Chip_ADCDAC_GetValueADC(NSS_ADCDAC0) * 1600) / 4096;
res = ((float)r_0 * adcInput)/ ((float)vdd_input - adcInput);