2025-04-07 11:36 PM
Hello, ST experts
The temperature sensor in STM32U595 is used for a mesurement. As datasheet said TS_CAL1 can be read at address 0x0BFA0710~0x0BFA0711. But this value is for 3.0V VREF, how is the situation if VREF and VDDA is 3.3V? How can I get the true temperature. E.g. for a chip I have the TS_CAL1 is 4130. What does that mean for 3.3V VREF?
BR
Yang
Solved! Go to Solution.
2025-04-08 12:11 AM
You have to multiply your measurement by (3.3 / 3.0), then do the rest of the calculations.
This is the example ST gives for the 32L0x2:
/* Temperature sensor calibration value address */
#define TEMP130_CAL_ADDR ((uint16_t*) ((uint32_t) 0x1FF8007E))
#define TEMP30_CAL_ADDR ((uint16_t*) ((uint32_t) 0x1FF8007A))
#define VDD_CALIB ((uint16_t) (300))
#define VDD_APPLI ((uint16_t) (330))
int32_t ComputeTemperature(uint32_t measure)
{
int32_t temperature;
temperature = ((measure * VDD_APPLI / VDD_CALIB) - (int32_t) *TEMP30_CAL_ADDR );
temperature = temperature * (int32_t)(130 - 30);
temperature = temperature / (int32_t)(*TEMP130_CAL_ADDR - *TEMP30_CAL_ADDR);
temperature = temperature + 30;
return(temperature);
}
2025-04-08 12:11 AM
You have to multiply your measurement by (3.3 / 3.0), then do the rest of the calculations.
This is the example ST gives for the 32L0x2:
/* Temperature sensor calibration value address */
#define TEMP130_CAL_ADDR ((uint16_t*) ((uint32_t) 0x1FF8007E))
#define TEMP30_CAL_ADDR ((uint16_t*) ((uint32_t) 0x1FF8007A))
#define VDD_CALIB ((uint16_t) (300))
#define VDD_APPLI ((uint16_t) (330))
int32_t ComputeTemperature(uint32_t measure)
{
int32_t temperature;
temperature = ((measure * VDD_APPLI / VDD_CALIB) - (int32_t) *TEMP30_CAL_ADDR );
temperature = temperature * (int32_t)(130 - 30);
temperature = temperature / (int32_t)(*TEMP130_CAL_ADDR - *TEMP30_CAL_ADDR);
temperature = temperature + 30;
return(temperature);
}