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.

Register Log in

Using adc in pic18f452

Status
Not open for further replies.

Barasha

Member level 2
Joined
Nov 15, 2011
Messages
49
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Location
Guwahati ,India
Activity points
1,579
Hello,

I am a beginner in mikroC. Need some explanation regarding 0x80 in the line shown below that are used in programs.

ADCON1 = 0x80; // Use AN0 and Vref=+5V
 

Joined
Dec 4, 2012
Messages
4,294
Helped
822
Reputation
1,654
Reaction score
793
Trophy points
1,393
Location
Bangalore, India
Activity points
0
Read the datasheet ADC Section. ADCON1 is the register used to set which PORT pins to be used as analog input pins, in some uC to set Vref +/- voltages and to left or righ justify the ADC result. If ADCON1 is 0x80 then the 8th (0 to 7) bit (MSB) od ADCON1 is set which will be usually for left justify the ADC result which appears in ADRESH and ADRESL registers.
 

Barasha

Member level 2
Joined
Nov 15, 2011
Messages
49
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Location
Guwahati ,India
Activity points
1,579
Hi salmanliaquat and jayanth.devarayanadurga

Thanks for the reply. Have seen the datasheet but still have a doubt about the data stored in ADRESH and ADRESL registers. Will the data stored be the digital value of the analog input.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top