Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

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...
 

vinodstanur

Advanced Member level 3
Joined
Oct 31, 2009
Messages
750
Helped
114
Reputation
234
Reaction score
114
Trophy points
1,333
Location
Kerala (INDIA)
Activity points
7,049
just try to read the ADC part in data sheet of PIC16F877A. Its clearly written there the entire steps and procedure for doing ADC.
 

vinodstanur

Advanced Member level 3
Joined
Oct 31, 2009
Messages
750
Helped
114
Reputation
234
Reaction score
114
Trophy points
1,333
Location
Kerala (INDIA)
Activity points
7,049
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:
  • Like
Reactions: Sly4pb

    Sly4pb

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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top