Internal 1.024 volt reference

rq3

Senior Member
The manual says that this is not available as an internal ADC reference, but it certainly appears to work., at least on a 20M2. Is the manual in error, or is there a hidden "gotcha"?
 

AllyCat

Senior Member
Hi,

Does the manual say "not available" (which is misleading) or "should not be used" (which is arguably correct)? Yes it does "work" (with all the M2 chips) but the manufacturer (Microchip) "recommends" (in its Data Sheets) that a Reference voltage of less than 1.8 volts should NOT be used for the ADC Reference Voltage. I suspect that's because the ADC may no longer achieve its published specification (e.g. as a full 10-bit ADC), but it might be "good enough" for some applications. So I have myself sometimes "recommended" its use, for example in preference to adding an external x2 Op-Amp to increase the ADC sensitivity.

Also, the FVR1024 is the "raw" 1.024 volt band-gap reference, whilst the FVR2048 and FVR4096 are the outputs from Rail-to-Rail Op Amps which may, for example, have a lower source impedance. In particular, I have observed "unsatisfactory" behaviour when using the FVR1024 to drive the DAC (but not the ADC).

Cheers, Alan.
 

rq3

Senior Member
Hi,

Does the manual say "not available" (which is misleading) or "should not be used" (which is arguably correct)? Yes it does "work" (with all the M2 chips) but the manufacturer (Microchip) "recommends" (in its Data Sheets) that a Reference voltage of less than 1.8 volts should NOT be used for the ADC Reference Voltage. I suspect that's because the ADC may no longer achieve its published specification (e.g. as a full 10-bit ADC), but it might be "good enough" for some applications. So I have myself sometimes "recommended" its use, for example in preference to adding an external x2 Op-Amp to increase the ADC sensitivity.

Also, the FVR1024 is the "raw" 1.024 volt band-gap reference, whilst the FVR2048 and FVR4096 are the outputs from Rail-to-Rail Op Amps which may, for example, have a lower source impedance. In particular, I have observed "unsatisfactory" behaviour when using the FVR1024 to drive the DAC (but not the ADC).

Cheers, Alan.
The manual says:
"Note that the 1.024V reference may not be used as the Vref+ of the ADC (only 2.048 or 4.096 may be used for this purpose). See the adcconfig command for more details. To reduce power use the FVR module is also automatically disabled after a readadc command, so reissue the fvrsetup command again after the readadc if that feature is still required. Note that the FVR voltage is reset to 1.024V via a ‘calibadc’ command."

Which is kind of strange, since it says don't do this, but then says that it used by the chip itself for calibadc. In any case FVR1024 appears to work fine on the 20M2, strictly as an ADC reference (I have no need for DAC). Just wondering if there is some weird temperature or supply voltage sensitivity I need to be aware of?
 

AllyCat

Senior Member
Hi,

No, CALIBADC uses the Vdd Supply Rail as the ADC Reference and then "measures" the FVR1024 against it (the Reference MUST be higher than the voltage that the ADC is trying to measure).

It depends how you interpret the word "may", but I've just checked the 14/20M2 base Microchip Data Sheet and it says in Note 4 on page 354: "When the FVR is selected as the reference input, the FVR Buffer1 output selection must be 2.048 or 4.096V". However, data sheets are sometimes overly pessimistic. :(

But IIRC the PICaxe manual is not correct in stating the following (or maybe it depends on which PICaxe is being used :
To reduce power ... the FVR module is also automatically disabled after a readadc command....
Yes, the FVR does have documented voltage and temperature sensitivities, but not particularly "weird".

Cheers, Alan.
 

Flenser

Senior Member
rq3 said:
Which is kind of strange, since it says don't do this, but then says that it used by the chip itself for calibadc.
The ADCCONFIG command simply tells you how to choose the FVR as the VRef+ for the ADC. Nothing complicated here
- for X2 chips Bit 3,2 is set to 10 to configure VRef+ as the FVR
- for M2 chips Bit 1,0 is set to 11 to configure VRef+ as the FVR

and both chips have the comment to see the FVRsetup command for setting which specific FVR value that will be usee as VRef+ for the ADC.

Then the FVRsetup command says "Note that the 1.024V reference may not be used as the Vref+ of the ADC (only 2.048 or 4.096 may be used for this purpose)." This seems clear to me.

I can't say why the FVRsetup command says you "may not" use FVR1024 for the ADC and I suspect that AlleyCat's comments about this are correct.

As you noted the FVRsetup command also has the comment "Note that the FVR voltage is reset to 1.024V via a ‘calibadc’ command"
This is just warning you, the programmer, that if you previously set FVR2048 or FVR4096, say for doing ADC readings, and you have a CALIBADC command somewhere in your program then you will need to remember to set the FVR back to FVR2048 or FVR4096 again after running CALIBADC or your ADC readings will not be what you expect.
 

Goeytex

Senior Member
The consistent theme throughout all of the PIC data sheets is not necessarily that FVR 1024 cannot be used for VREF+ but rather that VREF+ should be > 1.8 Volts. This would indeed preclude FVR1024 but would also preclude any external VFREF+ that is < 1.8V.

Carefully looking at a few datasheets, the 1.8V min VREF+ is specified with a VDD of 3.0 volts. If VDD for example is 5.0 volts, the chart in the datasheet becomes "iffy" if not somewhat ambiguous.

There is nothing inherently unstable with the FVR 1.024 reference voltage as opposed the 2.048 or 4.096 outputs . It is the 1:1 output of the same "independent programmable gain amplifier. " used for 2048 and 4096.

Microchip Developer Help regarding FVR does not mention the 1.8V min spec for FVR and reads as follows:


ADC Fixed Reference Voltage

The output of the FVR, when supplied to the Analog to Digital Converter (ADC), is routed through an independent programmable gain amplifier. The amplifier can be configured to amplify the reference voltage by a multiplier of 1x, 2x or 4x to produce the three possible voltage levels.

Based upon the somewhat ambiguous documentation I surmise:

The 1.8V min spec is based upon VDD = 3.0V.
The 1.8V min spec precludes use of FVR 1024 at 3.0V VDD as well an any external reference <1.8V
With VDD = 5.0V all bets are off as no spec is given

My testing on real chips with real applications has show that using FVR 1024 for ADC VREF+ works just fine with VDD = 5.0V
The accuracy is within 2 or 3 LSB with a 10K impedence and with good grounding techniques. I have not tested at 3.3V VDD.

I do not think that it should be interpreted that FVR 1024 is "forbidden" for use as ADC VREF+ but rather that Microchip does not guarantee the ADC accuracy Specifications with ADC FVREF+ / 1.024 .

I do not hesitate to use it when needed.
 

rq3

Senior Member
The consistent theme throughout all of the PIC data sheets is not necessarily that FVR 1024 cannot be used for VREF+ but rather that VREF+ should be > 1.8 Volts. This would indeed preclude FVR1024 but would also preclude any external VFREF+ that is < 1.8V.

Carefully looking at a few datasheets, the 1.8V min VREF+ is specified with a VDD of 3.0 volts. If VDD for example is 5.0 volts, the chart in the datasheet becomes "iffy" if not somewhat ambiguous.

There is nothing inherently unstable with the FVR 1.024 reference voltage as opposed the 2.048 or 4.096 outputs . It is the 1:1 output of the same "independent programmable gain amplifier. " used for 2048 and 4096.

Microchip Developer Help regarding FVR does not mention the 1.8V min spec for FVR and reads as follows:


ADC Fixed Reference Voltage

The output of the FVR, when supplied to the Analog to Digital Converter (ADC), is routed through an independent programmable gain amplifier. The amplifier can be configured to amplify the reference voltage by a multiplier of 1x, 2x or 4x to produce the three possible voltage levels.

Based upon the somewhat ambiguous documentation I surmise:

The 1.8V min spec is based upon VDD = 3.0V.
The 1.8V min spec precludes use of FVR 1024 at 3.0V VDD as well an any external reference <1.8V
With VDD = 5.0V all bets are off as no spec is given

My testing on real chips with real applications has show that using FVR 1024 for ADC VREF+ works just fine with VDD = 5.0V
The accuracy is within 2 or 3 LSB with a 10K impedence and with good grounding techniques. I have not tested at 3.3V VDD.

I do not think that it should be interpreted that FVR 1024 is "forbidden" for use as ADC VREF+ but rather that Microchip does not guarantee the ADC accuracy Specifications with ADC FVREF+ / 1.024 .

I do not hesitate to use it when needed.
goeytex, thanks for that. On a 20M2, FVR1024 certainly does work with a 5.0 volt supply, and per Alan's comment above, the FVR module is NOT reset after an ADC reading. So, as far as I can tell, the Microchip data sheets are ambiguous/incomplete/misleading, and have been interpreted into untrue statements in the Picaxe manuals. The trouble is that I'm working in uncharted territory as far as Microchip is concerned; i.e., there is no guarantee that this will always work, or even continue to work even though it does so now.

It will be a while, but I'll repeat my experiments with a 08M2.

Thanks all!
 
Top