Is it possible to calibrate ADC?
-
- Posts: 149
- http://meble-kuchenne.info.pl
- Joined: Tue Oct 19, 2021 9:31 am
- Has thanked: 75 times
- Been thanked: 5 times
Is it possible to calibrate ADC?
My MCU PIC16F883 ADC get wrong result. About 10% wrong. Can I calibrate it in Flowcode V9?
-
- Matrix Staff
- Posts: 1956
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 626 times
- Been thanked: 657 times
Re: Is it possible to calibrate ADC?
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.
Otherwide you can use the Map function to produce the desired calibrated result for byte or int.
Martin
-
- Matrix Staff
- Posts: 1956
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 626 times
- Been thanked: 657 times
Re: Is it possible to calibrate ADC?
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.
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.
Martin
-
- Posts: 206
- Joined: Thu Sep 23, 2021 3:44 pm
- Location: France
- Has thanked: 33 times
- Been thanked: 25 times
-
- Matrix Staff
- Posts: 1956
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 626 times
- Been thanked: 657 times
Re: Is it possible to calibrate ADC?
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.
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.
Martin