As Blup1980 mentioned, the AD7798 is a differential ADC. That means that it takes the difference of the two inputs and converts that value.
You have:
AIN(+) = +0.6V with reference to GND
AIN(-) = +2.5V with reference to GND
But the difference between the two is:
$$AIN = 0.6 - 2.5 = -1.9$$
So we have the following:
$$Code = 2^{N – 1} × [(AIN × GAIN/VREF) + 1]$$ $$7922 = 32768 × [(AIN × 1/2.5) + 1]$$ $$0.24176025390625 = (AIN × 1/2.5) + 1$$ $$-0.75823974609375 = AIN × 1/2.5$$ $$-1.895599365234375 = AIN$$
Which, is correct.
Converted into C code, we have:
int code_dec; float code_flt; float ain_valu; /* Initialize variables */ code_dec = 0U; code_flt = 0.0F; ain_valu = 0.0F; code_dec = AD7798_16(0x58, 0xFFFF); /* Get Code from ADC */ code_flt = (float)code_dec; /* Cast Code into float */ ain_valu = ((code_flt / 32768.0F) - 1.0F) / 0.4F; /* Perform calculation */ printf("Voltage is: %f\n", ain_valu); /* Print voltage value */ Casting the code value into a float and then using float values during every part of the calculation is good practice. Then you need the %f format specifier to ensure that the value is printed out as a floating point number which will include the negative sign if the value is negative. If you wish to include the positive sign for positive values, use %+f instead.