Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to give ADC reference voltage for PIC16F877A?

Status
Not open for further replies.

vinodstanur

Advanced Member level 3
Joined
Oct 31, 2009
Messages
751
Helped
114
Reputation
234
Reaction score
114
Trophy points
1,333
Location
Kerala (INDIA)
Activity points
7,054
I want to give ADC reference volts Vref+ (VDD/1000) and Vref-(VSS) .
HOW? (i want to give above vref in program.(not in AN3 and AN2)

my program with Vref+(VDD) and Vref-(VSS) is below and its working;
(most significant 8 bits are shown iin port b)
#include <htc.h>
#define _XTAL_FREQ 4e6 // 4MHz
__CONFIG(0x3F3A);
void main()
{
TRISB=0;
TRISA=1;
ADCON1=0b00001110;
__delay_us(10);

ADCON0=0b01000001;
__delay_us(10);
while(1)
{
ADGO=1;
while(ADGO);
PORTB=ADRESH;
__delay_ms(50);
}
}

73_1286797350.png
 

it is simple if you set the PCFG = 0000 or 0010 ir 0100 or 1001 or 1110 the vref+ is VDD .

:)
 
it is simple if you set the PCFG = 0000 or 0010 ir 0100 or 1001 or 1110 the vref+ is VDD .

:)

BUT my question is how to scale +vref to (VDD/10) or (VDD/1000) or like that , without using AN3 and AN2 by an external voltage divider circuit..
In above program PCFG is set as 1110. There the +vef is VDD.
I mean , is it possible to include the vref other than VDD and VSS in the program itself?:-(
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top