I have added the code I used for temperature sensor. I got a value 547 (decimal) for room temperature. How can I verify whether this is the correct value or not.
uint16 temperatureValue = 0; temperatureValue = HalAdcRead( HAL_ADC_CHN_TEMP, HAL_ADC_RESOLUTION_14 ); printf("%d", temperatureValue);
This gives me an output - 547
I failed to understand how temperature can be obtained from ADC value. The data sheet provides following information about temperature sensor.
PARAMETER |
TEST CONDITIONS |
MIN TYP MAX |
UNIT |
Output |
Measured using integrated ADC, internal band-gap voltage reference, and maximum resolution |
1480 |
12-bit |
Temperature coefficient |
4.5 |
/ 1°C |
|
Voltage coefficient |
1 |
0.1 V |
|
Initial accuracy without calibration |
±10 |
°C |
|
Accuracy using 1-point calibration |
±5 |
°C |
|
Current consumption when enabled |
0.5 |
mA |
I don't know how to get the current temperature using these.