2020-03-27 04:29 AM
Board: NUCLEO STM32F103RB - MB1136 C-01
Hi all,
I try read, trought ADC1_IN0 (pin PA0) , the temperauture value from LM35, but read wrong value.
LM35: connected at 5V, GND and A0.
ADC1_IN0: work at 8 MHz with voltage reference of 3.3V and 12 bit of resolution.
In ADC-> DR register is store a value of 535 equal about 44°C but the temperature in the room is about 20°C.
I think there is a problem with the voltage reference of the ADC. Can you help me?
Solved! Go to Solution.
2020-03-27 03:38 PM
> Why i have a problem with sampling time hight?
There are requirements on the minimum sample time for internal channels such as VREFINT, VTEMP and VBAT. Look at the datasheet for your chip to see what they are.
If you feel this question is answered, please select "Select as best" to mark a post as the answer.
2020-03-27 07:05 AM
Increase sampling time.
2020-03-27 10:25 AM
Hi TDK,
thanks for your attention.
I change the ADC frequency at 10.67 MHz, in the ADC_SMPR1 register is all zero, therefore the sampling time is 1,5 cycle. The problem persist.
Why do you think that the problem is te sampling time? The temperature has a slow variation in the time.
2020-03-27 10:34 AM
> therefore the sampling time is 1,5 cycle
This is the minimum sampling time. I suggested you increase it, but it looks like you haven't and are still asking me why it's not working.
2020-03-27 11:58 AM
You're right, i got distracted.
Now, i reduced the sampling time and the value of temperature is correct. Why i have a problem with sampling time hight?
2020-03-27 03:38 PM
> Why i have a problem with sampling time hight?
There are requirements on the minimum sample time for internal channels such as VREFINT, VTEMP and VBAT. Look at the datasheet for your chip to see what they are.
If you feel this question is answered, please select "Select as best" to mark a post as the answer.