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.

error :Cannot open file (Include File "“P16F84A.inc”

Status
Not open for further replies.

uttamthakur131990

Newbie level 1
Joined
Mar 12, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,287
my code error in mplab is
1: Cannot open file (Include File "“P16F84A.inc”" not found)
2:Symbol not previously defined (OPTION_REG)

MY CODE IS GIVEN BELOW

Code:
#include “P16F84A.inc”
Movlw 5 
Movwf TRISA 
Movlw 2 
Movwf OPTION_REG 
Movf TRISA, W 
Nop 
End

Please help me
 

Not familiar with PIC assembler, but from the error, it looks like it has two sets of quotes in the error response you've printed. Remove the quotes from the #include line. Quotes are used in C, but no idea if this assembler like the same format or not.
Also, double-check you actually do have such a file P16F84A.inc by using Windows Explorer and looking for it in the location where your assembler resides.
BTW, not many people use assembler these days, so move to C as soon as possible.
 

Try using the following instead:

Code:
    list        p=16F84A      
    #include    <p16F84A.inc>

Reference: MPASM™ Assembler, MPLINK™ Object Linker, MPLIB™ Object Librarian User’s Guide, Section: 4.41 #include – INCLUDE ADDITIONAL SOURCE FILE, Pg.92

4.41 #include – INCLUDE ADDITIONAL SOURCE FILE

4.41.1 Syntax

Preferred:
#include include_file
#include "include_file"
#include <include_file>

Supported:
include include_file
include "include_file"
include <include_file>


4.41.2 Description

The specified file is read in as source code. The effect is the same as if the entire text
of the included file were inserted into the file at the location of the include statement.
Upon end-of-file, source code assembly will resume from the original source file. Up to
5 levels of nesting are permitted. Up to 255 include files are allowed.

If include_file contains any spaces, it must be enclosed in quotes or angle
brackets. If a fully qualified path is specified, only that path will be searched. Otherwise,
the search order is:

• current working directory
• source file directory
• MPASM assembler executable directory


4.41.3 Usage

This directive is used in the following types of code: absolute or relocatable. For
information on types of code, see Section 1.6 “Assembler Operation”.
You should use the include directive once to include that standard header file for your
selected processor. This file contains defined register, bit and other names for a
specific processor, so there is no need for you to define all of these in your code.


4.41.4 See Also

#define #undefine


4.41.5 Simple Example

#include p18f452.inc ;standard include file
#include "c:\Program Files\mydefs.inc" ;user defines


You should also use the banksel assembler directive to ensure you are currently in the proper bank before accessing SFRs like the TRISA and OPTION_REG.

BigDog
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top