2020-10-19 08:03 AM
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...
Solved! Go to Solution.
2020-10-20 04:52 AM
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.
2020-10-19 10:03 AM
Hello @Gahlen Feld ,
You can follow this formula:
The RM0454 will be updated in coming release to add the missing information.
I hope this formula is helpful for you.
Imen
2020-10-19 11:59 PM
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.
2020-10-20 12:27 AM
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.
2020-10-20 03:04 AM
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)
2020-10-20 04:52 AM
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.
2020-10-20 07:46 AM
>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...