Hi, Ian,
Regarding the formula A*[alpha*(Vbe8-Vbe1)/(Vbe8 + alpha*(Vbe8-Vbe1))] - B, it is an empirical formula. Based on test, after you sample 4 result, then discard the first two samples, and use the last samples and use above formula can get the best temperature result.
Hope it can help you
BR
XiangJun Rong
section 39.7.6 Temperature sensor copied from UM11126.pdf
39.7.6 Temperature sensor
The ADC has a dedicated input channel for an on-chip temperature sensor. It is mapped
on channel 26.
To calculate the temperature, the ADC must be configured to run a specific sequence of
steps:
1. Channel 26 corresponds to the temperature sensor.
2. Configure a command register to sample the temperature sensor channel.
CMDLT[ADCH] = Temperature Sensor Channel.
3. The command must be programmed with the following parameters: CMDLT[CTYPE]
= 0x2, CMDHT[AVGS] = 0x7, CMDHT[LOOP] = 0x3, CMDHT[LWI] = 0x0,
CMDHT[STS] = 0x7, CMDHT[CMPEN] = 0x0.
4. Configure a trigger control register to associate it with the temperature sensor
command: TCTRLT[TCMD] = CMDT.
5. Trigger a conversion to run the command associated with TCTRLT.
After running the temperature sensor command, four results (TS[1:4]) are written to the
FIFO selected with TCTRLT[FIFO_SEL_A]. A specific combination of the lasts two values
(TS[3] and TS[4]) allows on chip temperature to be calculated through software.
To convert the temperature sensor conversion results to the on-chip temperature value:
1. Discard the TS1 and TS2 results, and read the last two conversion results (TS[3] and
TS[4])].
2. The first data from step 1 (TS[3]) is called vbe1. The second data (TS[4]) is called
vbe8.
3. An equation can be used to convert these results into the final temperature sensor
reading: A*[alpha*(Vbe8-Vbe1)/(Vbe8 + alpha*(Vbe8-Vbe1))] - B.
4. Depending on the device revision, following Alpha., A and B values are needed to
achieve +/- 4 C temperature accuracy. For device revision 0A: Alpha=9.5, A=770 and
B = 289.4. For device revision 1B: Alpha= 8.5, A=804 and B = 280.