Page 1 of 1

12-Bit Adc

Posted: Fri Nov 20, 2009 7:33 am
by luthra_arun
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
******************************/

Re: 12-Bit Adc

Posted: Fri Nov 20, 2009 12:27 pm
by Sean
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?

Re: 12-Bit Adc

Posted: Fri Nov 20, 2009 1:12 pm
by luthra_arun
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.

Re: 12-Bit Adc

Posted: Fri Nov 20, 2009 4:38 pm
by Sean
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.

Re: 12-Bit Adc

Posted: Sun Nov 22, 2009 7:27 am
by luthra_arun
If you can post your ADC question in the Flowcode V4 section of the Forum, I will reply to it early next week.
But in Flowcode V4 fourm the new post botton is not visible.That is why i am posting my problems in General PICmicro programming.

Re: 12-Bit Adc

Posted: Mon Nov 23, 2009 7:43 am
by Steve
Please see the "posting on the V4 forum" for information about this:
http://www.matrixmultimedia.com/mmforum ... &sk=t&sd=a