Page 1 of 1

18F6722 ADC Questions

Posted: Thu Jan 25, 2018 3:09 pm
by anzacinexile
Again, apologies from someone who's still learning fast but a couple of dumb questions concerning the ADC channels of the above chip if I may.

I intend to use a voltage reference of 4.096V and I realize that any voltage on the ADC channels above this will result in the ADC "topping out" but will any voltage over the reference but under VDD physically damage the ADC channel? I have 820 ohm resistors in series to limit any current to safe levels but the data sheet is not very clear.

A second question, whilst researching using the VRef function I notice that with some chips, a lump of C code seems to be necessary to configure registers. Does the 18F6722 need the same or is it a simple matter of setting VRef in the ADC properties.

Thanks for your patience

Chris

Re: 18F6722 ADC Questions

Posted: Thu Jan 25, 2018 7:02 pm
by QMESAR
anzacinexile wrote: I intend to use a voltage reference of 4.096V and I realize that any voltage on the ADC channels above this will result in the ADC "topping out" but will any voltage over the reference but under VDD physically damage the ADC channel?
As you correctly said if you use a 4.096 Vref then any volltage above the Vref will not be captured by the ADC.if you use VDD and VSS (Power rail voltage as reference (0-5V) you can capture 0 -5V(0- 1023 ADC bits) with the ADC pin.No as long as you stay with in the 0 -5V max range you will not damage the ADC and current limiting Resistors is not needed.
You also have to be careful when placing current limiting resistors in line with an ADC pin as the ADC has a maximum impedance (Resistance Value ) that is allowed at the ADC pin above this value(in Electrical spec of ADC in Datasheet) will cause error results .
A second question, whilst researching using the VRef function I notice that with some chips, a lump of C code seems to be necessary to configure registers.
This is not necessary in Flow code
if you place an input such as a Potensiometer on the 3 or 2 D panel and select it then go to properties panel
124.jpg
124.jpg (3.32 KiB) Viewed 4001 times
You will see that you can select the Voltage of the Reference and also the reference to use as well as the Number of acquisitions and ADC conversion speed setting
123.jpg
123.jpg (64.79 KiB) Viewed 4001 times

Hope this helps good luck

Re: 18F6722 ADC Questions

Posted: Fri Jan 26, 2018 9:46 am
by anzacinexile
As always, a great help for a newbie like me. Many thanks QMESAR for clarifying things for me.

Chris

Re: 18F6722 ADC Questions

Posted: Fri Jan 26, 2018 12:51 pm
by QMESAR
Chris you are welcome :D
Good luck and enjoy Flowcode