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.

[SOLVED] ANSEL ANSELH C1ON_bit problem? why should i use these?

Status
Not open for further replies.

dashkil

Member level 2
Joined
Mar 3, 2012
Messages
45
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,620
I am using PIC-16f877A and Mikroc PRO for PIC 4.60v; i have gone through help menu and trying different example given there; each code contains ANSEL=0; ANSELH=0; C1ON_bit=0; but when i copy these code to compile some error is shown such as:

1) Undeclared identifier 'ANSEL' in expression prj_00.c
2) Undeclared identifier 'ANSELH' in expression prj_00.c
3) Undeclared identifier 'C1ON_bit' in expression prj_00.c

Why these error are shown even though it is given in help menu as reference?

As a worthy information by removing these command i have successfully compiled the code but including these always showing the error mentioned above.
 

The help menu uses the 16F887.

The 16F877A does not contain the ANSEL or ANSELH registers or the C1ON bit.

Instead of the lines containing ANSEL, ANSELH and C1ON (which are to turn off the ADC and comparator in this situation), use:
Code:
ADCON1 = 7;
CMCON = 7;

Hope this helps.
Tahmid.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top