18F6722 ADC Questions

An area to discuss 8-bit PIC specific problems and examples

Moderator: Benj

Post Reply
anzacinexile
Posts: 55
Joined: Tue Apr 01, 2014 9:10 am
Has thanked: 16 times
Been thanked: 18 times
Contact:

18F6722 ADC Questions

Post 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

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: 18F6722 ADC Questions

Post 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 3288 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 3288 times

Hope this helps good luck

anzacinexile
Posts: 55
Joined: Tue Apr 01, 2014 9:10 am
Has thanked: 16 times
Been thanked: 18 times
Contact:

Re: 18F6722 ADC Questions

Post by anzacinexile »

As always, a great help for a newbie like me. Many thanks QMESAR for clarifying things for me.

Chris

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: 18F6722 ADC Questions

Post by QMESAR »

Chris you are welcome :D
Good luck and enjoy Flowcode

Post Reply