Continue to Site

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.

Analog and digital pins in PIC16f877a

Status
Not open for further replies.

oday_albadarneh

Newbie level 6
Joined
Dec 20, 2011
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,380
Hi all,
I'm using MiKroC to program a PIC16f877a, and i want to configure pins A0,A1 as analog pins wile A2-A5 as digital input. i use this code but it didn't work


Code:
  ADRESL = 0x03;
  ADRESH = 0x00;
  TRISA  = 0xFF;

had i forget anything to put in the code ?! any modifications or suggestions ?!!
PLZ Help me ASAP, with great thanks for all :)
 

you need to initiallize the ADCON1 register of the bit PCFG3 - PCFG0; you could give the value 0101 for PCFG3 - PCFG0.

you cant declare A2 to A5 as digital, in between A3 will act as a VRef..

see the 16f877 datasheet of 130th page.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top