2025-11-18 1:16 AM - last edited on 2025-11-18 1:19 AM by Andrew Neil
Hello,
Why is there a significant difference between the values obtained through the ADC and DTS for the internal temperature measurement of STM32H563?
3. Here are the measurement results. They vary significantly. Why is that?
Thank you for your help.
Solved! Go to Solution.
2025-11-26 7:00 AM - edited 2025-11-26 7:07 AM
Hello @BJX and sorry for the late reply.
First, in next time please share your code using </> button instead of posting screen shots. Please read How to insert source code or simply attach your project including the ioc file.
Second, as you are not sharing the DTS configuration, I have a doubt you set the DTS divider to 0.
According to the reference manual, the DTS counter clock must be lower than 1MHz during the calibration phase. This divider is bypassed during the temperature reading phase.
Note also DTS has many erros listed in the datasheet:
Analog temp sensor errors:
I'm attaching an example inspired from the code you shared running on NUCLEO-H563 board where the temperature difference between the analog sensor and the digital sensor is around 3 deg °C which is I think acceptable considering the DTS and temperature analog sensor errors .
I used VOS2 to minimize the error reading as shown in the table shown above. HCLK= 150MHz (for VOS2), APB1 prescaler = 2 (APB1 clock freq = 75). DTS clock divider = 75. So the DTS clock counter = 1MHz.
Hope that helps.
2025-11-26 7:00 AM - edited 2025-11-26 7:07 AM
Hello @BJX and sorry for the late reply.
First, in next time please share your code using </> button instead of posting screen shots. Please read How to insert source code or simply attach your project including the ioc file.
Second, as you are not sharing the DTS configuration, I have a doubt you set the DTS divider to 0.
According to the reference manual, the DTS counter clock must be lower than 1MHz during the calibration phase. This divider is bypassed during the temperature reading phase.
Note also DTS has many erros listed in the datasheet:
Analog temp sensor errors:
I'm attaching an example inspired from the code you shared running on NUCLEO-H563 board where the temperature difference between the analog sensor and the digital sensor is around 3 deg °C which is I think acceptable considering the DTS and temperature analog sensor errors .
I used VOS2 to minimize the error reading as shown in the table shown above. HCLK= 150MHz (for VOS2), APB1 prescaler = 2 (APB1 clock freq = 75). DTS clock divider = 75. So the DTS clock counter = 1MHz.
Hope that helps.