cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G070: how to calculate the current ambient temperature from internal temperature sensor?

Gahlen Feld
Associate II

Hello,

my question implies that there is no value for TS_CAL2 available for the STM32G070, although its reference manual RM0454 describes it on page 292 (14.9 Temperature sensor and internal reference voltage: Reading the temperature). Since there is also TS_CAL2 not mentioned in the data sheet, I could also ask: what is the right address in system memory for TS_CAL2? When I take the address from a STM32G071 device an calculate with this value in my STM32G070RB the temperature value makes no sense...

1 ACCEPTED SOLUTION

Accepted Solutions

It depends on your device if there is any useful correlation between ambient and die temperature.

I don't know the G070 device in particular, but I would follow the usual calibration method:

Take (at least) two samples at known temperatures, and implement your own calibration function.

The datasheet formula as Imen Dahmen provided is usually an average value, and will fluctuate between different devices.

View solution in original post

6 REPLIES 6
Imen.D
ST Employee

Hello @Gahlen Feld​ ,

You can follow this formula:

0693W000001sk41QAA.png 

The RM0454 will be updated in coming release to add the missing information.

I hope this formula is helpful for you.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Gahlen Feld
Associate II

Thank you, Imen, for your quick answer.

I will implement the temperaure measurement according to your proposal.

Unfortunately, when calculating with the average slope value from the data sheet, the resulting temperature value is less accurate due to its non-linear nature compared to the method from the reference manual by applying 2 individually measured data points.

Your answer implies that there is no TS_CAL2 value stored in system memory for STM32G070 devices.

Ozone
Lead

I would consider this a bad idea.

The die temperature is influenced by the current MCU load and the ambient temperature inside the casing of your device.

Which most probably includes other nearby heat sources.

Gahlen Feld
Associate II

you are right, Ozone, fortunately our application has a constantly low MCU load -> we can assume that the measured temperature is mostly affected by the only one nearby heat source which dictates us to protect it by switching it off (but this is a very slow process)

It depends on your device if there is any useful correlation between ambient and die temperature.

I don't know the G070 device in particular, but I would follow the usual calibration method:

Take (at least) two samples at known temperatures, and implement your own calibration function.

The datasheet formula as Imen Dahmen provided is usually an average value, and will fluctuate between different devices.

>The datasheet formula ... will fluctuate between different devices.

yes I know and we are very unhappy with this for the STM32G070...

maybe we upgrade to a STM32G071 MCU which at least has 2 device specific calibration values in system memory...