2024-03-11 04:28 AM
Hi,
I'm using STM32G070RBTx, and I use this formula from document RM0360 to compute temeperature:
From page 56 of document https://www.st.com/resource/en/datasheet/stm32g070cb.pdf, I'm using:
Avg_Slope = 2.5 and V30 = 0.76.
The temperature converted value I obtain at ambient temperature appears reasonable ( 21 °C approx. ) but when the temperature increases the raw value I get from ADC also increases but using formula above gives a decreasing temperature value and this is wrong.
Please help.
Solved! Go to Solution.
2024-03-11 05:45 AM - edited 2024-03-11 05:46 AM
Perhaps you are using an older version of the RM. Here it what the current version says:
This is the same as your formula except the sign on V30 and V_SENSE has changed.
2024-03-11 05:45 AM - edited 2024-03-11 05:46 AM
Perhaps you are using an older version of the RM. Here it what the current version says:
This is the same as your formula except the sign on V30 and V_SENSE has changed.
2024-03-12 07:28 AM - edited 2024-03-12 07:35 AM
Thanks TDK for reply, a couple of questions:
1) is VDDA in the formula the voltage power supply I use to power my board, that is 3.3 V, or is the voltage power supply used during factory calibration that is 3.0 V ?
2) in the formula provided shouldn't be Sense_DATA = TS_DATA / VDDA * 3.3 ?
2024-03-12 07:34 AM
Your actual VDDA value.
2024-03-12 07:48 AM
1) "VDDA" in the calculation should be VREF+ on the board you are taking the ADC measurement on (your board).
2) No, I don't think so. But it should be 3.0 V since that's what the TS_CAL was taken at.
A better formula would be:
Where TS_CAL1 is read from memory, TS_CAL1_VREF+ (3.0) and TS_CAL1_TEMP (30 C) are taken from the datasheet.
2024-03-12 08:56 AM - edited 2024-03-12 09:38 AM
Thanks for helping, the formula provided appears to be working fine.