The Godfather talking
Share your stuff or I will make you regret it.
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2016, 11:33:26 11:33


Login with username, password and session length


Pages: [1]
Print
Author Topic: [ASM] "include" error in MPLAB  (Read 2784 times)
0 Members and 1 Guest are viewing this topic.
tAhm1D
Senior Member
****
Offline Offline

Posts: 336

Thank You
-Given: 103
-Receive: 180



« on: March 28, 2009, 04:21:14 16:21 »

Hi,

I have used MPLAB v6.40, v7.30 and now v7.52. While programming in assembly language, I faced a problem with all the versions of MPLAB. Even after I include the header file like include "p18f4520.inc" I still have to declare the special function registers as MPLAB cannot detect the SFRs mentioned in the included header file. What is the problem? Huh
Logged
oldvan
V.I.P
Senior Member
*****
Offline Offline

Posts: 375

Thank You
-Given: 152
-Receive: 106


If the van is a Rockin'...


WWW
« Reply #1 on: March 28, 2009, 07:29:26 19:29 »

Have you tried MPLAB 8.2?  Versions 6 and 7 are pretty badly antiquated.  You could be struggling with an old and now fixed problem.

If you want, post a sample of what you are trying and I'll try it here, let you know result.
Logged

Give a man a fish and you feed him for a day.
Teach a man to fish and he will sit around in a boat drinking beer all day.
tAhm1D
Senior Member
****
Offline Offline

Posts: 336

Thank You
-Given: 103
-Receive: 180



« Reply #2 on: April 01, 2009, 08:39:52 20:39 »

Have you tried MPLAB 8.2?  Versions 6 and 7 are pretty badly antiquated.  You could be struggling with an old and now fixed problem.

If you want, post a sample of what you are trying and I'll try it here, let you know result.
Hi oldvan,
I have downloaded MPLAB 8.3 and started using it. Even in this version, same problem persists. I think, there may be an inherent problem in MPLAB in this regard. However, if you can find any solution, please let me know.
Logged
oldvan
V.I.P
Senior Member
*****
Offline Offline

Posts: 375

Thank You
-Given: 152
-Receive: 106


If the van is a Rockin'...


WWW
« Reply #3 on: April 01, 2009, 11:29:54 23:29 »

Please post a sample of what you are doing, I've just been working on an assembly language program for the 16F877 using MPLAB 8.2 with no problems.  I suspect you are making a small error that once corrected can make your life MUCH easier.
Logged

Give a man a fish and you feed him for a day.
Teach a man to fish and he will sit around in a boat drinking beer all day.
Parmin
Hero Member
*****
Offline Offline

Posts: 544

Thank You
-Given: 357
-Receive: 126


Very Wise (and grouchy) Old Man


« Reply #4 on: April 02, 2009, 12:04:35 00:04 »

Do you specify the path directory for the .inc file?
Logged

If I have said something that offends you, please let me know, so I can say it again later.
oldvan
V.I.P
Senior Member
*****
Offline Offline

Posts: 375

Thank You
-Given: 152
-Receive: 106


If the van is a Rockin'...


WWW
« Reply #5 on: April 02, 2009, 01:45:27 01:45 »

Should be no need to call out the entire path, MPASM should know where they live.

The following worked fine in my program:

Code:
#INCLUDE <P16F877.INC>  ; THIS IS WHERE CHIP REGISTERS AND BITS ARE DEFINED

Logged

Give a man a fish and you feed him for a day.
Teach a man to fish and he will sit around in a boat drinking beer all day.
xzb
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 16
-Receive: 5


« Reply #6 on: April 02, 2009, 03:25:42 03:25 »

I used  v8.2 Whatever one or ones( #INCLUDE <P18F4520.INC>  #INCLUDE "P18F4520.INC" )no problem.
Logged
tAhm1D
Senior Member
****
Offline Offline

Posts: 336

Thank You
-Given: 103
-Receive: 180



« Reply #7 on: April 02, 2009, 02:29:18 14:29 »

Should be no need to call out the entire path, MPASM should know where they live.

The following worked fine in my program:

Code:
#INCLUDE <P16F877.INC>  ; THIS IS WHERE CHIP REGISTERS AND BITS ARE DEFINED



Hi oldvan,
In my case it is not working. Let me put a small Test program. In the following Test program with Pic18f4520,where 2 leds in portb are lit, include path is not working and only when portb and trisb is defined in the program (remove the semicolon), only then the program is build successfully. Why? Please assemble the program and let me know kindly.
« Last Edit: April 02, 2009, 02:34:47 14:34 by tAhm1D » Logged
oldvan
V.I.P
Senior Member
*****
Offline Offline

Posts: 375

Thank You
-Given: 152
-Receive: 106


If the van is a Rockin'...


WWW
« Reply #8 on: April 02, 2009, 04:45:27 16:45 »

Case seems to be causing the problem in this case.

For MPASM,
Code:
           clrf  portb

Is not the same as:
Code:
           CLRF  PORTB

Try it and report back.  :-)
Logged

Give a man a fish and you feed him for a day.
Teach a man to fish and he will sit around in a boat drinking beer all day.
tAhm1D
Senior Member
****
Offline Offline

Posts: 336

Thank You
-Given: 103
-Receive: 180



« Reply #9 on: April 02, 2009, 05:44:31 17:44 »

Hi oldvan,
Now it works. Yes, the problem was because of the case. So simple but so problematic.
« Last Edit: April 02, 2009, 05:52:36 17:52 by tAhm1D » Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC