2019-11-10 09:31 AM
I looked into the user manual, but don't really know how to calculate that. I'd really appreciate it if someone could give me some clue on that
2019-11-10 09:50 AM
Cite the specific part number you're talking about, link to the document.
Usually fractional values need to be scaled, rebased, or use some fixed-point representation.
2019-11-10 09:59 AM
Are you talking about the HTS221? This is not a STM32 chipset function.
2019-11-10 10:39 AM
Yes, I think so
2019-11-10 10:55 AM
Thank you indeed!
This is the reference manual of the chip I use. The temperature sensor is internally connected to the ADC input channel which is used to convert the sensor’s output voltage to a digital value.
The temperature reading steps are listed as in the picture according to the reference manual
2019-11-10 12:06 PM
This would be the die temperature of the STM32L4. Couple of calibration points are stored as words in the ROM/OTP memory.
You're scaling and rebasing, given an 80 degree (temp) slope and the value read from the ADC. Secondary school math I'd suppose.
Try feeding in TS_DATA (ADC) values of TS_CAL1 and TS_CAL2 and confirm you're understanding by pulling out the expected temps.