cancel
Showing results for
Did you mean:

# STM32H743 Internal CPU Temperature

Associate II

Hello, I am trying to calculate the internal CPU temperature on an STM32H743, When reading the internal CPU temperature sensor using ADC3 IN18 (internal temperature), I get a very high value (~731C)
The formula I'm using is the following :

Temperature (in °C) = (110 °C – 30 °C) / (TS_CAL2 – TS_CAL1) * (TS_DATA – TS_CAL1) + 30 °C

Here is the algorithm to read the temp :

4. Start TIM6 (PSC = 10, ARR=59999) for the sampling frequency of the ADC3,  and the samplingTime is  810.5
5. Calculate TS_CAL1, TS_CAL2
6. Convert ADC value to C°

Here is the code :

HAL_TIM_Base_Start_IT(&htim6);

float32_t Temperature = (110  – 30 ) / (adcCalTemp110C – adcCalTemp30C ) * (DMABuff[10] – adcCalTemp30C ) + 30;
I don't know if I missed something that has to be included?
Kind regards
Anas,

13 REPLIES 13
Chief II

Hi,

did you set Tsen ?

Associate II

Yes indeed I set the TSEN with the following :
And then I run the calibration

Associate II

@AScha.3 It is still showing the same output even thought I enabled TSEN

Any ideas ?
many thanks

Chief II

What values you get from ADC real ? (in hex)

Associate II

Dear @AScha.3,
With the following ADC value inside DMABuff (0x7f08):

I get

1. Temperature = 734 C°
2. ADC (in mV) = 2413.89

Chief II

from ds :

-> thats about 4x the value you should get !

So whats your VDDA + Vref ?

+

In Cube, adc setup, you set to : 16bit , no oversampling, no shift ?

Associate II

@AScha.3, appreciate the fast replies

I define :
CALIBRATION_REFERENCE_VOLTAGE as 3.3V
REFERENCE_VOLTAGE 3.0V // supplied with Vref+ or VDDA

Then :

And also here is how I set the ADC3 in Cube

Chief II

So whats your AVDD and  VREF+  ? check with DMM at the connected pins.

Try ADC settings : overrun data overwritten .