2024-05-06 01:32 AM
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 :
Here is the code :
MX_ADC3_Init();
HAL_ADCEx_Calibration_Start(&hadc3,ADC_CALIB_OFFSET_LINEARITY, ADC_SINGLE_ENDED);
HAL_ADC_Start_DMA(&hadc3, (uint32_t *)&DMABuff[0], 11);
HAL_TIM_Base_Start_IT(&htim6);
const uint16_t* ADC_TEMP_3V3_30C = (uint16_t*)(0x1FF1E820);
const uint16_t* ADC_TEMP_3V3_110C = (uint16_t*)(0x1FF1E840);
float adcCalTemp30C = (float) (*ADC_TEMP_3V3_30C);
float adcCalTemp110C = (float) (*ADC_TEMP_3V3_110C);
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,
2024-05-07 07:58 AM
>Any ideas ?
No ... it has to work then. Just curious : you get 4x the expected value -- not any random thing. Hmmm...
Other test: if you convert any input from ADC pin, set to a known voltage, lets say: 1V at the pin, what you get then from ADC ?
2024-05-07 11:39 AM
Hi @anasba
This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.
Regards,
Billy
2024-05-08 06:11 PM
Hey,
I'm facing similar issue on H743VIT6. Internal temperature is almost 10 times. Even the 3.3V sensing is wrong. I'm using the H743VIT6 rev V.
2024-05-14 12:53 AM
I have an idea which might explain where the issue comes from.
Here are the details :
Will that influence the CPU sensor calibration/acquisition ?
Many thanks