cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H5 inconsistent internal temperature measurement using ADC and DTS?

BJX
Associate II

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.

 

 

Love me in the eye.
1 ACCEPTED SOLUTION

Accepted Solutions
mƎALLEm
ST Employee

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
mƎALLEm
ST Employee

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.