AD7770 Temperature Sensor

I’m using an AD7770 as my main ADC on a custom board I’m designing. I’ve been playing with some prototypes and experimenting with the AD7770’s built-in temperature sensor. Using the code from ADI’s website I’m reading back some odd values for temperature. Can you please help me figure out how to interpret this data?

Here’s how I’m reading the temperature sensor data:

// Set the ADC SAR up to measure DVbe
ret |= AD7770_set_sar_cfg(dev, AD7770_ENABLE, AD7770_DVBE_AVSSX);

// Pull the SAR’s conversion start line low
ADC_CONSAR_LOW;

// Wait at least 1 us
delay_us(1);

// Pull the SAR’s conversion start line high
ADC_CONSAR_HIGH;

// Wait at least 4 us
delay_us(4);

// Set the ADC’s SPI up to read back the SAR result
ret |= AD7770_set_spi_op_mode(dev, AD7770_SAR_CONV);

// Read the SAR data into the uint16_t global variable
ret |= AD7770_spi_sar_read_code(dev, AD7770_DVBE_AVSSX, &g_uiADCTemperature);


If I then calculate the temperature as the datasheet seems to imply (below) I get the wrong values.
g_fTemperature = 25.0f - ((float)g_uiADCTemperature / 4095.0f - 0.6f) / 0.002f;

Using an empirically derived Ax + B seems to work pretty well
g_fTemperature = (0.787f) * (float)g_uiADCTemperature + (-1882.0f);

I put my board (with the AD7770) in a temperature chamber and monitored the reported temperature value (it updates every ~10 seconds) using the Ax + B method.
At -40C it reported -40.4 which implies a SAR value of 2340.
At +85C it reported 82.4 which implies a SAR value of 2496.
At ~28C it reported 27.3 which implies a SAR value of 2426.

I’m not sure how to use the datasheet’s formula for temperature… Thoughts?