cancel
Showing results for 
Search instead for 
Did you mean: 

ADC calibration on the reference voltage

RSy.1
Associate III

Hello I am exploring the ADC functionality of STM32F103C8T6. I connected a potentiometer to PA2 and connected an LED at PA0 as indicator. The indicator shall get activated once the potentiometer reaches the set threshold. I tried to set the maximum to 4095 which should be 3.3V. However I noticed that the LED did not get activated at the full swing of the potentiometer. I tried lowering down the threshold to 4000 and then the LED got activated at the full swing of the potentiometer. This 4000 is equivalent to about 3.2V only. May I ask what is the reason for this? Is the reference voltage not calibrated. Or is a calibration required?

5 REPLIES 5
TDK
Guru

4095 corresponds to your VREF+ voltage which is typically VDD. Depending on your pot, you may not be actually reaching this.

If you hook up VDD to your ADC input, you should get 4095 or very close to. Increase sample time to improve accuracy.

If you feel a post has answered your question, please click "Accept as Solution".
RSy.1
Associate III

Thank you. Yes somehow the potentiometer is not reaching the full scale.

RSy.1
Associate III

Hi TDK I just looked at the datasheet. I was surprised to find out that the VREF+ range is from to 2.4V to VDD (VDD max is 3.6V). The swing is too wide. Is there a way to calibrate this...to set to 3.3V for a consistent ADC readout?

TDK
Guru

You're misinterpreting. VREF+ voltage is whatever voltage you apply on that pin. If you want it precise, apply a precision voltage reference on that pin.

If you feel a post has answered your question, please click "Accept as Solution".
RSy.1
Associate III

Thanks TDK for the clarification.