linkstatic
Junior Member level 1
Code:
#pragma config OSC=HS,OSCS=OFF
#pragma config BOR=ON,BORV=45,PWRT=ON
#include<P18F452.h>
#include<delays.h>
void main()
{
TRISC=0;
TRISD=0;
TRISAbits.TRISA0=1;
ADCON0=0x81;
ADCON1=0xCE;
while(1)
{
Delay10TCYx(1);
ADCON0bits.GO=1;
while(ADCON0bits.DONE==1);
PORTC=ADRESL;
PORTD=ADRESH;
}
}
i just wanted to know do i have to connect the (vref +) to +5v and (vref-) to ground? and is the code right or not?