Page 2 of 2

Re: Internal Voltage Reference_Solved!

Posted: Thu May 03, 2012 2:34 pm
by Benj
Hello Uli,

That's great glad you made some progress. Yes that looks like a good way of doing it to me. You could customise the code for the ADC channels so that it automatically called the correct voltage before sampling if you wanted.

i.e.

ADC0 Read As Int would start with

fvrcon=0x82;

and ADC1 Read As Int would start with

fvrcon=0x83;

This way you can just sample the channel and the correct voltage will be assigned automatically.

If the datasheet doesn't mention the extra voltage setting then my guess is it may be for something else. Maybe the comparator module? I think the ADC module needs a fair amount of voltage to allow it to resolve the input voltage.

Re: Internal Voltage Reference_Solved!

Posted: Sat Jun 02, 2012 1:10 pm
by Creative25
Hi Benj,
If i change settings.
fvrcon=0x83; etc.
Does it get stored in internal memory or is it just loaded into ram.
Can I change these settings unlimited while running the program?

Another question.
If i have a reference voltage of 2.048 volts on vfr.
And the input gets higher than this but is not bigger than the supply voltage does the chip get damaged?
What rating diode should I use?
Best Regards:
Uli

Re: Internal Voltage Reference_Solved!

Posted: Thu Jun 07, 2012 10:00 am
by Benj
Hello Uli,
If i change settings.
fvrcon=0x83; etc.
Does it get stored in internal memory or is it just loaded into ram.
Can I change these settings unlimited while running the program?
It is loaded into the RAM location in charge of holding the state of the fvrcon register. Yes you can write to registers as often as you like in your program.
If i have a reference voltage of 2.048 volts on vfr.
And the input gets higher than this but is not bigger than the supply voltage does the chip get damaged?
What rating diode should I use?
Hm this may have potential to damage the chip or the ADC module on the chip. I would refer to the device datasheet and see if you can find any info regarding this. Could you maybe use a in line series resistor and a reversed biased zener to limit the voltage that can be transferred into the input pin.

Re: Internal Voltage Reference_Solved!

Posted: Thu Jun 07, 2012 12:02 pm
by Creative25
Hi Benj
Thanks for the answer.
I am actually planning to use a serious register and a zener diode.
Just wonder what is the best place to put it.
I have a incoming voltage of maximum 30 volts and would have a voltage divider probably one 15K and one 1k resistor.
Should I put the zener diode between the two resistors or should I place it before the voltage divider and use an extra resistor?
Best Regards:
Uli.

Re: Internal Voltage Reference_Solved!

Posted: Thu Jun 07, 2012 2:36 pm
by Benj
Hi Uli,

I would probably do it something like this. Because the ADC pin is high impedance the zener and series resistor will not consume any current/voltage until close to the cutoff voltage so maybe watch your readings for accuracy near the top end of the scale.
Untitled-1.gif
Untitled-1.gif (1.7 KiB) Viewed 7621 times
The series resistor should limit the current enough so that the zener will not blow when pulling down any excess voltage.

Re: Internal Voltage Reference_Solved!

Posted: Sun Jun 10, 2012 1:03 am
by Creative25
Thanks Benj.
I also posted my question on the Microchip forum.
I will come back when I have an answer from them what the maximum Input voltage is with Fvr 2.048V
Where would a put in input filter capacitor?
Parallel to the zener diode, or at vin?
Uli

Re: Internal Voltage Reference_Solved!

Posted: Mon Jun 11, 2012 9:53 am
by Benj
Hello Uli,

Probably best to place the smoothing cap across the source voltage, eg at Vin.

Re: Internal Voltage Reference_Solved!

Posted: Mon Jun 11, 2012 10:05 am
by Creative25
Hi Benj
What do you mean by Vin?
Is it the place from where the voltage to be entered is taken from ,or is it the adc input?
Thanks
Uli

Re: Internal Voltage Reference_Solved!

Posted: Mon Jun 11, 2012 4:17 pm
by Benj
Hi Uli,

Vin as marked on the diagram :D

Re: Internal Voltage Reference_Solved!

Posted: Mon Jun 11, 2012 5:16 pm
by Creative25
Thanks I did not realize you talk about the diagram.
Uli

Re: Internal Voltage Reference_Solved!

Posted: Tue Jun 19, 2012 1:23 pm
by Creative25
Hi
Some time ago I posted a question if it will damage the chip if I would use FVR 2.048 on an ADC and the voltage is more than that but less than VDD
apparently you can go maximum 0.3 volts higher than VDD without damaging the Chip but or coure it can not show more than 2.048 volts.
Best Regards:
Uli

Re: Internal Voltage Reference_Solved!

Posted: Tue Jun 19, 2012 2:27 pm
by Benj
Great thanks for letting us know.

Nice to know the ADC can't be damaged by enabling a reference voltage in software that is lower then the incoming voltage on the analogue pin.