Skip to main content
Graduate
November 18, 2025
Solved

STM32H5 inconsistent internal temperature measurement using ADC and DTS?

  • November 18, 2025
  • 1 reply
  • 179 views

Hello,

Why is there a significant difference between the values obtained through the ADC and DTS for the internal temperature measurement of STM32H563?

  1. Below is the measurement program of ADC.
    BJX_0-1763456716403.pngBJX_1-1763456746799.png
    BJX_2-1763456778561.png
  2.  The following is the measurement procedure of DTS.
    BJX_8-1763457278477.png

     


    BJX_4-1763456827738.png

 



 

 

    3. Here are the measurement results. They vary significantly. Why is that?

BJX_6-1763457059604.png

BJX_7-1763457119676.png

Thank you for your help.

 

 

    This topic has been closed for replies.
    Best answer by mƎALLEm

    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.

    mALLEm_0-1764168541800.png

    Note also DTS has many erros listed in the datasheet:

    mALLEm_1-1764168744613.png

    Analog temp sensor errors:

    mALLEm_0-1764169626407.png

    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.

    1 reply

    mƎALLEmAnswer
    Technical Moderator
    November 26, 2025

    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.

    mALLEm_0-1764168541800.png

    Note also DTS has many erros listed in the datasheet:

    mALLEm_1-1764168744613.png

    Analog temp sensor errors:

    mALLEm_0-1764169626407.png

    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.