Hi to all,
I am using pic controller having the 12-bit adc .I just read the data from the Adc channel 0 in ReadasInt and display on the LCD when i vary from 0-5 v i got the value from 0-1023 instead of 0-4095. below i had set the settings in flow code.
/**** Macro Substitutions ****
0 = Which ADC Channel
100 = Acquisition time
3 = Conversion Speed
0 = VRef+ Option
500 = VRef Voltage x 0.01V
******************************/
12-Bit Adc
-
Sean
- Valued Contributor

- Posts: 548
- Joined: Tue Jun 26, 2007 11:23 am
- Has thanked: 6 times
- Been thanked: 44 times
Re: 12-Bit Adc
The Flowcode ADC ReadAsInt macro currently returns a 10-bit value regardless of the resolution of the target hardware (maintaining compatibility between devices).
If full 12-bit resolution is required, it should be possible to modify a copy of the appropriate fcd and adc C code file to achieve this (simulation will remain at 10-bit resolution).
Which chip are you using?
If full 12-bit resolution is required, it should be possible to modify a copy of the appropriate fcd and adc C code file to achieve this (simulation will remain at 10-bit resolution).
Which chip are you using?
-
luthra_arun
- Posts: 18
- Joined: Wed Nov 11, 2009 7:39 am
Re: 12-Bit Adc
hi sean,
I am using pic18f4523 having the 12-bit adc.There is a problem with the C code using in flow code the problem is the variable i had declare in the flow code is not called in c code macro.The other way what i thing is to same the adc value in controller innternal eeprom and read in the flow code but it will take the time .What you suggest.
I am using pic18f4523 having the 12-bit adc.There is a problem with the C code using in flow code the problem is the variable i had declare in the flow code is not called in c code macro.The other way what i thing is to same the adc value in controller innternal eeprom and read in the flow code but it will take the time .What you suggest.
-
Sean
- Valued Contributor

- Posts: 548
- Joined: Tue Jun 26, 2007 11:23 am
- Has thanked: 6 times
- Been thanked: 44 times
Re: 12-Bit Adc
There are several postings on the forum showing how Flowcode variables can be used within C code:
Convert all characters in the variable name to upper-case and add the prefix FCV_ for global variables, or FCL_ for macro local variables.
I will look into some options for the ADC resolution issue. This is now a Flowcode V4 topic.
If you can post your ADC question in the Flowcode V4 section of the Forum, I will reply to it early next week.
Convert all characters in the variable name to upper-case and add the prefix FCV_ for global variables, or FCL_ for macro local variables.
I will look into some options for the ADC resolution issue. This is now a Flowcode V4 topic.
If you can post your ADC question in the Flowcode V4 section of the Forum, I will reply to it early next week.
-
luthra_arun
- Posts: 18
- Joined: Wed Nov 11, 2009 7:39 am
Re: 12-Bit Adc
But in Flowcode V4 fourm the new post botton is not visible.That is why i am posting my problems in General PICmicro programming.If you can post your ADC question in the Flowcode V4 section of the Forum, I will reply to it early next week.
- Steve
- Matrix Staff
- Posts: 3434
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: 12-Bit Adc
Please see the "posting on the V4 forum" for information about this:
http://www.matrixmultimedia.com/mmforum ... &sk=t&sd=a
http://www.matrixmultimedia.com/mmforum ... &sk=t&sd=a