STM32H723 / 733 / 735 analog temperature sensor vs. ADC Vref
Heyho,
got my custom board running, only (minor) problem until now:
internal analog temperature sensor (ADC3) value seems to be off, showing something like ~60°C,
while an external sensor shows about 30°C.
"Finger test" confirms rather the 30°C.
I have the exactly same code running on H723 Nucleo and H735 Disco, the values I get from these make sense.
ADC3 is working, I'm measuring about 7 supply voltages on the board and the internal Vref, all these values are close to perfect.
The only difference:
VREFP pin is connected to an external voltage reference with 3.0 V, VDDA is 3.3 V, compared to the Vref 3.3V on the ST boards.
So how does this affect the temperature sensor?
Even with a factor of (3.3 / 3.0) the measured temperature is still far off.
Here's how temperature is calculated, input is an averaged float from ADC buffer (I checked that this value is close to a single raw ADC value):
/* convert averaged float ADC value to temperature */
float ConvAdc2Temp(float flAdcTemp)
{
/* calculate temperature, see reference manual */
float flTempVal = flAdcTemp;
flTempVal -= (float)((int32_t)*TEMPSENSOR_CAL1_ADDR);
flTempVal *= (float)TEMPI_CAL_MULT;
flTempVal += (float)((int32_t)TEMPSENSOR_CAL1_TEMP);
return flTempVal;
}Here's the output, including the MCU's internal calibration values, which are very close to those on the ST boards:
MCU internal temperature sensor:
ADC3 TmpSns: 866 / 0x0362
flTempMCU: 62.2 °C
TEMPSENSOR_CAL1_TEMP = 30
TEMPSENSOR_CAL2_TEMP = 110
*TEMPSENSOR_CAL1_ADDR = 768
*TEMPSENSOR_CAL2_ADDR = 1022
TEMPI_CAL_MULT = 0.31496
TMP101 external temperature sensor:
flTempSns: 34.0000 °C

