Hi all
Perhaps somebody can offer some advice -
I have successfully been using a PIC 16F690 to take ADC measurements, using Vdd as the reference (i.e. setting the VCFG bit of the ADCON0 register to zero).
However, I'd like to take measurements relative to a precision reference, but so far I have failed.
I have rigged up a LM431 precision reference (using the PIC's 5v supply, a 2K resistor and 10uF capacitor in the arrangement shown in Nigel Goodwin's tutorial: . This works fine, giving 2.5v out. But, when I connect this output to the PIC's Vref pin, the voltage at that pin reads 0.05v on my meter and the ADC does indeed seem to be using a very low reference voltage indeed - not the 2.5v I was expecting!
I cant find a software mistake. ADC results are fine when using Vdd as a reference. I believe all that is needed to switch to using a reference voltage on the Vref pin is to ensure:
The TRIS bit for the Vref pin (TRISA bit 1) is set to zero (disable digital IO)
The VCFG flag inthe ADCON0 register (bit 6) is set to 1 (use Vref)
Can anyone suggest something I may have overlooked/misunderstood?
Thanks
Phil
Perhaps somebody can offer some advice -
I have successfully been using a PIC 16F690 to take ADC measurements, using Vdd as the reference (i.e. setting the VCFG bit of the ADCON0 register to zero).
However, I'd like to take measurements relative to a precision reference, but so far I have failed.
I have rigged up a LM431 precision reference (using the PIC's 5v supply, a 2K resistor and 10uF capacitor in the arrangement shown in Nigel Goodwin's tutorial: . This works fine, giving 2.5v out. But, when I connect this output to the PIC's Vref pin, the voltage at that pin reads 0.05v on my meter and the ADC does indeed seem to be using a very low reference voltage indeed - not the 2.5v I was expecting!
I cant find a software mistake. ADC results are fine when using Vdd as a reference. I believe all that is needed to switch to using a reference voltage on the Vref pin is to ensure:
The TRIS bit for the Vref pin (TRISA bit 1) is set to zero (disable digital IO)
The VCFG flag inthe ADCON0 register (bit 6) is set to 1 (use Vref)
Can anyone suggest something I may have overlooked/misunderstood?
Thanks
Phil