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.

PIC Based ADC Converter

Status
Not open for further replies.

pp99

Newbie level 3
Joined
Jun 16, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,303
Anyone know about 16F877A 8 bit PIC based ADC Converter?

Can give me some introduction and what is this conversion aim/objectives?

Thanks.
 

andre_luis

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,391
Helped
1,174
Reputation
2,367
Reaction score
1,166
Trophy points
1,403
Location
Brazil
Activity points
54,640
What compiler are you using ?
Some ones have example codes...

+++
 

dayanpad

Advanced Member level 4
Joined
Mar 23, 2009
Messages
114
Helped
17
Reputation
34
Reaction score
17
Trophy points
1,298
Location
Colombo
Activity points
1,921
This example code reads analog value from channel 2 (RA2) and displays it on PORTB and PORTC.

unsigned int temp_res;

void main() {
ANSEL = 0x04; // Configure AN2 pin as analog
ANSELH = 0; // Configure other AN pins as digital I/O
C1ON_bit = 0; // Disable comparators
C2ON_bit = 0;

TRISA = 0xFF; // PORTA is input
TRISC = 0; // PORTC is output
TRISB = 0; // PORTB is output

do {
temp_res = ADC_Read(2); // Get 10-bit results of AD conversion
PORTB = temp_res; // Send lower 8 bits to PORTB
PORTC = temp_res >> 8; // Send 2 most significant bits to RC1, RC0
} while(1);
}

I think this is You will be helpful

Above cods using microC compiler
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top