Internal Voltage Reference_Solved!
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Voltage Reference_Solved!
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: Internal Voltage Reference_Solved!
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
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
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Voltage Reference_Solved!
Hello Uli,
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 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?
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.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?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: Internal Voltage Reference_Solved!
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.
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.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Voltage Reference_Solved!
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.
The series resistor should limit the current enough so that the zener will not blow when pulling down any excess voltage.
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.
The series resistor should limit the current enough so that the zener will not blow when pulling down any excess voltage.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: Internal Voltage Reference_Solved!
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
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
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Voltage Reference_Solved!
Hello Uli,
Probably best to place the smoothing cap across the source voltage, eg at Vin.
Probably best to place the smoothing cap across the source voltage, eg at Vin.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: Internal Voltage Reference_Solved!
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
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
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Voltage Reference_Solved!
Hi Uli,
Vin as marked on the diagram
Vin as marked on the diagram

Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
Re: Internal Voltage Reference_Solved!
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
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
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Voltage Reference_Solved!
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel