2019-05-23 08:35 AM
Hi all,
I am trying to use internal temperature sensor on Nucleo L011K4 and using macro from LL library (__LL_ADC_CALC_TEMPERATURE_TYP_PARAMS) I get complete garbage.
STM32Cube_FW_L0_V1.11.2
STM32CubeMx 5.0.1
LL libraries used, no HAL
ADC is running in DMA mode with HW oversampling by 8, 12.5 clock S&H time (should be enough for TEMP sensor) and each ADC EOS this value again averaged in SW.
When I looked closely to datasheet and reference manual I wrote my code without this macro and I still getting nonsense data out of it. I found that TS_CAL2 value from Factory Option bytes is far different than expected value, so when I used 670 constant instead - and I got something real temperature finally.
Question 1: why at production calibration value is like 1.5 times bigger than supposed to be?
Question 2: Is there a bug in LL macro? It looks like there one unnecessary multiply by 1000
Question 3: Do I need to recalibrate temp sensor at 130C or can use different temperature?
Question 4: Can I store calibration value in option bytes and how?
Question 5: Is TS_CAL1 value can be used if I calibrate it by myself? I want measure temperature using 2 points calibration.
Solved! Go to Solution.
2019-05-28 07:23 AM
Note that the calibration at the factory was done using Vdda=3V, but the Nucleo eval board uses Vdda=3.3V. Did you account for this difference?
Would you be able to:
Thanks!