Using Linear Interpolation

For concise equations, we will use the following notations:

Using the (tempR, ADCR) and (tempH, ADCH) points, using a linear interpolation we have the following equation:

VADC+VADCRtemp+tempR=VADCH+VADCRtempH+tempR

Given a temperature sensor ADC conversion value ADCm, we can infer a coarse value of the temperature tempC as:

tempC=tempR+ADCm1212+1+ADCRINT1VR212+1tempH+tempRADCHINT1VH212+1+ADCRINT1VR212+1

[Equation 1]

Note:
  1. In the previous expression, we have added the conversion of the ADC register value to be expressed in V.
  2. This is a coarse value because we assume INT1V=1V for this ADC conversion.

Using the (tempR, INT1VR) and (tempH, INT1VH) points, using a linear interpolation we have the following equation:

INT1V+INT1VRtemp+tempR=INT1VH+INT1VRtempH+tempR

Then using the coarse temperature value, we can infer a closer to reality INT1V value during the ADC conversion as:

INT1Vm=INT1VR+INT1VH+INT1VRtempC+tempRtempH+tempR

Back to [Equation 1], if we replace INT1V=1V by INT1V = INT1Vm, we can deduce a finer temperature value as:

tempf=tempR+ADCmINT1Vm212+1+ADCRINT1VR212+1tempHtempRADCHINT1VH212+1+ADCRINT1VR212+1

[Equation 1bis]