2025-03-03 7:22 AM - edited 2025-03-03 8:08 AM
Hi
We are currently working on a new board with a STM32H562. As part of the design, we want to measure the temperature of the MCU. In the Datasheet of the STM32H562 I see the “Analog temperature sensor” (as I know it from other STM32) connected to the ADC and a (maybe a new) “Digital temperature sensor (DTS)”. A few questions regarding the two sensors:
Thanks and Regards
Marco
2025-03-03 5:54 PM
Good question and interesting to remember.
Yes, you are right: there is an analog temperature sensor, readable via ADC channel and a digital one (DTS).
My thoughts:
Where these sensors are placed on the die? No idea (no information), but I would assume: the analog sensor sits somewhere on the die in a "free corner or spot" where the DTS sits potentially right in the middle of the digital logic, e.g. close to PLLs, as part of the digital logic.
What is the difference? (as I understand)
The DTS gives you a frequency (not a temperature value). This frequency is correlated with the temperature effects on digital logic. Datasheet says: the input clock as reference is PCLK or LSE. So, I assume: if you have a clock source, e.g. internal RC oscillator, or you use the external LSE clock (with a crystal there) - their frequency depends on the temperature. So, measuring the temperature via the resulting frequency makes sense to me:
more accurate, faster to realize temperature "drifts". Especially if you generate another system clock via PLLs.
I would imagine, that this DTS covers also the temperature effect on digital logic inside chip, e.g. a PLL.
The analog temperature is more to measure the overall die temperature, where as the DTS is more to realize the effect on temperature changes (and must faster realizing gradients) on clock generators (PLLs) or digital logic (e.g. signal delays).
Differences?
No idea about the resolution of the measured value. I would assume:
the analog sensor is slower, more to check the maximum die temperature (in general), the DTS way faster and able to "measure the effect" on temperature changes, e.g. digital logic, clock generators, PLLs, ...
When to use?
(my thoughts): The analog sensor to make sure the die will not be overheated, to reduce the speed, voltage, ... when the chip (in general) gets too hot.
The DTS if you need very accurate clock references, or realizing that the timing of digital logic (e.g. gate delays, PLL stability and correctness) "drifts". Used more to "compensate" temperature effects, instead of protecting the chip against thermal damages (or "measuring" the "incorrectness" of digital logic (speed, accuracy)).
2025-03-04 4:21 AM - edited 2025-03-04 4:22 AM
Thanks for your reply and interesting thoughts.
@tjaekel wrote:[...] the input clock as reference is PCLK or LSE. So, I assume: if you have a clock source, e.g. internal RC oscillator, or you use the external LSE clock (with a crystal there) - their frequency depends on the temperature.
In the reference manual ST writes:
27.3.7 Temperature measurement principles
The analog part of temperature sensor outputs a signal (CLK_PTAT) which FM(T) frequency is temperature-dependent.
Either PCLK or LSE can be selected as reference clock (REF_CLK) through the REFCLK_SEL bit in DTS_CFGR1.
The counting method depends on the REF_CLK frequency. This is due to the fact that two counters are implemented in the temperature sensor block:
• For low REF_CLK frequencies, a counting of FM(T) cycles is performed during one or
several REF_CLK cycles.
• For high REF_CLK frequencies, a counting of REF_CLK cycles is performed during one or several FM(T) cycles
As I understand this, the DTS creates his own clock, which changes with temperature. So basically, it is an oscillator with a bad temperature stability. Then PCLK or LSE is used to measure the frequency generated by the oscillator of the DTS. With the frequency the temperature can then be calculated. Therefore, the PCLK or LSE needed to be stable with temperature to get an accurate result.
Two others thoughts I had:
I think a Application Note from ST, comparing the Digital vs Analog temperature sensor, giving more background about the implementation, and intended use case would great.
2025-03-04 11:36 AM
Thank you for the interesting question and also on the contribution and insights, DTS was introduced on on STM32H72x/2x series and then used on recent MCUs and is pure digital not having the need to activate ADC and Analog related blocs , to have more flexibility on different application usage and not interrupting Analog conversations, it can be used to Act quickly using IRQ and shutdown some clocks like entering sleep mode or and even scaling down the clocks to avoid exceeding Junction temperature or temperature profile used by application, We will be back to you with more details with our Architects and designers and I would propose a Knowledge Article update and refresh for more applications use cases on top of configuration: https://community.st.com/t5/stm32-mcus/how-to-configure-and-use-the-dts-digital-temperature-sensor-on/ta-p/49806
Thanks again for the suggestion !
ciao
STOne-32
2025-03-04 11:58 PM
An Update of the Knowledge Article with the answers to my questions would be perfect.
The DTS is a really interesting addition to the STM32, but figuring out the benefits (especial compared to the Analog temperature sensor) is currently a bit cumbersome.