PDA

View Full Version : Using + & -vref on PIC, how to?



pjsmith
- 6th August 2004, 23:03
Hi,

How do I tell the PIC to use the a/d reference voltages supplied on pins RA2 & RA3. I'm supplying RA3 with 2.5v, I've not configured them as inputs, but it still makes no difference to the a/d conversion samples I'm making on RA0

Thanks.

Melanie
- 7th August 2004, 02:29
Look in the A/D Converter section of the PIC's Datasheet. Since we don't know what PIC you're using we can't point you to the correct page. Yes, the VRef pins have to be made inputs with the correct TRISA setting, but you also have to configure your A/D registers appropriately for using an external VRef...

For the 16F876/877 in the Datasheet look at the ADCON1 register (Datasheet 11-2) there you will see a table which details the AD Port Configuration Control Bits (on my Datasheet Ref 30292C it's on page 112). They have to be set appropriately for the AD Configuration of your choice.

Until you've told the PIC you're using external VRef's it's not exactly going to work.