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 C°. I searched on the internet for this and I found two different methods:
Method 1: Page 226 in http://www.st.com/content/ccc/resource/technical/document
Temp(degree) = (V_sense - V_25)/Avg_slope + 25
Method 2: Page 251 in http://www.st.com/content/ccc/resource/technical/document
Temp(degree) = ( ( (110 - 30)*(TS_DATA - TS_CAL1) ) / (TS_CAL_2 - TS_CAL_1) ) + 30
Where:
- TS_CAL2: temperature sensor calibration value at 110 C°
- TS_CAL1: temperature sensor calibration value at 30 C°
- TS_DATA: temperature sensor output from ADC
It confuses me which one is the correct formula for calculating the temperature in C°. 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?