This limitation is given purely by the VF61 SoC, we try to measure small voltage changes with a 3.3V fullscale ADC. The temperature measurement happens all inside the CPU:
I looked up the datasheet, the values there are slightly different from the code on the developer site.
The temperature sensor is an on-chip silicon diode with the following characteristics:
- Forward voltage @25°C:
V_TEMP25 = 696mV
- Temperature Slope:
m = -1.84mV/°C
The ADC characteristics are:
- ADC reference voltage
V_REFH = 3300mV
- LSB voltage @10bits =
V_LSB = (V_REFH / 2^10)
The measured temperature can be calculated as follows:
V_ADC = adcValue * V_LSB
= adcValue / 2^10 * 3300mV
T_CPU = 25°C + (V_ADC - V_TEMP25) * m
25°C + (V_ADC - 696mV) * (-1.84mV/°C)
You can try to measure using 12bits (Simply adjust the
2^10 term in the equation above). I didn’t verify whether the additional resolution is really helpful, or just overruled by noise.
Also note that
m are just typical values. For a precise measurement, they need to be calibrated for each individual device.