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



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

Cookies are required to use this site. You must accept them to continue using the site. Learn more…