Page 1 of 1

Is it possible to calibrate ADC?

Posted: Wed Sep 25, 2024 9:52 am
by Sergejs
My MCU PIC16F883 ADC get wrong result. About 10% wrong. Can I calibrate it in Flowcode V9?

Re: Is it possible to calibrate ADC?

Posted: Wed Sep 25, 2024 4:39 pm
by medelec35
If you are using GetVoltage macro then you can adjust the voltage result by changing VRef within properties.
Otherwide you can use the Map function to produce the desired calibrated result for byte or int.

Re: Is it possible to calibrate ADC?

Posted: Thu Sep 26, 2024 8:08 am
by Sergejs
Problem resolved with crystal at 20 mHz. I use internal oscillator before. But when I put crystal resonator ADC works properly. Thanks for all.

Re: Is it possible to calibrate ADC?

Posted: Thu Sep 26, 2024 8:15 am
by medelec35
It could be that you had the wrong selection of conversion speed for the microcontroller clock speed.
If not sure what conversion speed to use, just select the highest and work your way down.
I generally leave it on the highest myself.

Re: Is it possible to calibrate ADC?

Posted: Fri Oct 04, 2024 6:44 am
by Xbiotec
medelec35 wrote:
Wed Sep 25, 2024 4:39 pm
If you are using GetVoltage macro then you can adjust the voltage result by changing VRef within properties.
Otherwide you can use the Map function to produce the desired calibrated result for byte or int.
Hi what do you mean by MAP function?

Re: Is it possible to calibrate ADC?

Posted: Fri Oct 04, 2024 8:26 am
by medelec35
You can use the Map component to change the input range for bytes or int variables to give the desired output.
For example:
from input of 0 - 1023 to output 0 - 1000
Therefore, when the ADC = 1023 the value will convert to 1000
The map component can be found in the Math section of the component library.
If you right-click on the component and select Help, it will take you to the Flowcode Wiki site, where you can download an example.

Re: Is it possible to calibrate ADC?

Posted: Fri Oct 04, 2024 10:22 am
by Xbiotec
thx