I'm using STM32F401RE Nucleo board to measure the ambient temperature. After the sampling process, I receive a digital value from ADC_CHANNEL_TEMPERATURE and I want to convert this digital value into degree celcius. I searched on the internet for this and I found two different methods:

Method 1: Page 226 in RM0368 Reference manual (STM32F401 series)

`Temp(degree) = (V_sense - V_25)/Avg_slope + 25`

Method 2: Page 251 in RM0091 Reference manual (STM32F0 series)

`Temp(degree) = ( ( (110 - 80)*(TS_DATA - TS_CAL1) ) / (TS_CAL_2 - TS_CAL_1) ) + 30 Where: - TS_CAL2: temperature sensor calirbation value at 110 degree - TS_CAL1: temperature sensor calirbation value at 30 degree - TS_DATA: temperature sensor output from ADC`

It confuses me which one is the correct formula for calculating the temperature in degree celsius. Although Method 1 is from reference manual of STM32F401, the temperature result doesn't look correctly. While Method 2 from reference manual of STM32F0 series, it looks more reasonable.

Still I don't know which formula should I apply when using STM32F401RE Nucleo board ?

Thanks

I use the code for the '091

it works well, sitting at 42.2C

and you have a typo, it should be -30, not -80...