STM32L4 ADC Configuration to read internal temperature sensor's data.
Hello there,
I am working on STM32L4's ADC and wants to measure internal temperature sensor's readings.
But somehow, I am facing some issues here.
1. Calculated Temperature is incorrect:
I used below equation, provided in reference manual RM0393's 16.4.31 section, to calculate actual temperature:
Temperature (in Celsius) = ((110 - 30) * (TS_DATA - TA_CAL1) / (TS_CAL2 - TS_CAL1)) + 30
where,
TS_DATA = 886 (640.5 Cycles)
TS_CAL1 = 1035 (read from address 0x1FFF 75A8-A9)
TS_CAL2 = 1373 (read from address 0x1FFF 75CA-CB)
Calculated temperature = -5 (at room temperature, about 26 Celsius)
Clearly, here is some issue. Can you please guide me to resolve it ?
ADC Configuration:
Resolution : 12-bit
sampling time : 640.5 Cycles
End of Conversion Selection : End of Single Conversion
Scan mode / Continuous mode / Discontinuous Mode : Disabled
If required, I can provide code for above mentioned testings.
.
2. Sampling Time:
What should be proper value of 'Sampling Time', while calculating Temperature ?
I know that 'Sampling time' is relevant with some hardware impedance, but don't know what impedance is set for internal temperature sensor.
.
3. Max impedance for 12-bit resolution:
As mentioned in the datasheet, maximum RAin external impedance is 50K.
But, for 12-bit resolution, we are allowed to use 39K only (for fast channels)
(reference: Table 63, Page 115 of STM32L4's data sheet)
Can we set impedance > 39K for 12-bit resolution?
Please guide me here.
Thank You,
Maunik Patel
