calculating temperature for STM32L451 - tried both methods, but don't get correct readings
According to the data sheet, the calibrated values for specific chip (at 30°C and 130°C) are at the following addresses:
#define TEMP30_CAL_ADDR (*((uint16_t*)0x1FFF75A8))
#define TEMP130_CAL_ADDR (*((uint16_t*)0x1FFF75CA))
Therefore the calculation should be :
fCalTemperature_DegreeCelsius = (((130.0f - 30.0f) / (TEMP130_CAL_ADDR - TEMP30_CAL_ADDR)) * (ADC_TempReading - TEMP30_CAL_ADDR)) + 30.0f;The problem is that in memory the values don't seem to be correct:
I'd appreciate any help.
Thanks,
Mechi
