PIC16F877a 8channels ADC

Status
Not open for further replies.

Sly4pb

Newbie level 2
Joined
May 20, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,293
Hello, i rly dont know much about PIC so i need ur help.I need 8 channels analog to digital conversion code for PIC16F877a in micro c. THX

dont use sms typing skills in forum... all your threads and post will be deleted if continued...
 

halo friend you dont use short form or sms .you will be bann from admin or modarator . Best of luck
 

just try to read the ADC part in data sheet of PIC16F877A. Its clearly written there the entire steps and procedure for doing ADC.
 

Code:
void adc_init()
{
TRISA0=1;
ADCON0=0b10000001; //check the significance of each bits in datasheet and modify according to ur need
ADCON1=0b10001110;//check the significance of each bits in datasheet and modify according to ur need
}
void read_adc()
{
ADGO=1;
while(ADGO);
readdata=ADRESH; //readdata must be defined as int 
readdata<<=8;
readdata|=ADRESL;
}
 
Last edited:
Reactions: Sly4pb

    Sly4pb

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…