Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

problem with MPLAB

Status
Not open for further replies.

4electros

New Member
I was trying to compile this code in MPLAB program but it in formed me that some errors occured during the process...


PROCESSOR 16F84
#INCLUDE "p16f84.inc"

__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & XT_OSC



;**** declaration and variables*****
cblock 0x0c
endc

org 0x00
goto Main

org 0*04
goto Main

Main
banksel TRISB
CLRF TRISB

banksel PORTB

movlw 0xff

movwf PORTB

LOOP goto Loop


End


and the error message is:

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "E:\science\Microcontroller\PIC\MPLAB IDE\MCHIP_Tools\mpasmwin.exe" /q /p16F84 "BLINK.asm" /l"BLINK.lst" /e"BLINK.err"
Warning[205] E:\PIC\BLINK.ASM 2 : Found directive in column 1. (PROCESSOR)
Error[113] E:\PIC\BLINK.ASM 5 : Symbol not previously defined (XT_OSC)
Warning[205] E:\PIC\BLINK.ASM 10 : Found directive in column 1. (cblock)
Warning[205] E:\PIC\BLINK.ASM 11 : Found directive in column 1. (ENDC)
Warning[205] E:\PIC\BLINK.ASM 13 : Found directive in column 1. (org)
Warning[203] E:\PIC\BLINK.ASM 14 : Found opcode in column 1. (goto)
Warning[205] E:\PIC\BLINK.ASM 16 : Found directive in column 1. (org)
Warning[203] E:\PIC\BLINK.ASM 17 : Found opcode in column 1. (goto)
Error[118] E:\PIC\BLINK.ASM 17 : Overwriting previous address contents (0000)
Error[118] E:\PIC\BLINK.ASM 17 : Overwriting previous address contents (0000)
Warning[205] E:\PIC\BLINK.ASM 20 : Found directive in column 1. (banksel)
Warning[203] E:\PIC\BLINK.ASM 21 : Found opcode in column 1. (CLRF)
Message[302] E:\PIC\BLINK.ASM 21 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[205] E:\PIC\BLINK.ASM 23 : Found directive in column 1. (banksel)
Warning[203] E:\PIC\BLINK.ASM 25 : Found opcode in column 1. (movlw)
Warning[203] E:\PIC\BLINK.ASM 27 : Found opcode in column 1. (movwf)
Error[113] E:\PIC\BLINK.ASM 29 : Symbol not previously defined (Loop)
Warning[205] E:\PIC\BLINK.ASM 32 : Found directive in column 1. (End)
Error[173] E:\PIC\BLINK.ASM 33 : source file path exceeds 62 characters (E:\SCIENCE\MICROCONTROLLER\PIC\MPLAB IDE\MCHIP_TOOLS\P16F84.INC)
Halting build on first failure as requested.
BUILD FAILED: Mon Sep 19 21:06:04 2005


Please help!! thanks in advance!!
 
"Found directive in column 1 " means that you need to add a blank space before the directive, typically a Tab or a few spaces. The first column is reserved to labels, like "Main" in your case.

Look a code templates that come with MPLAB if you want to see quickly how an actual ASM source code file should look like.
 
Joel Rainville said:
Everything you need to correct is stated in the orange text you pasted. What more do you need?

He meant how to resolve this particular error:

Error[173] E:\PIC\BLINK.ASM 33 : source file path exceeds 62 characters (E:\SCIENCE\MICROCONTROLLER\PIC\MPLAB IDE\MCHIP_TOOLS\P16F84.INC)
 
Joel Rainville said:
Everything you need to correct is stated in the orange text you pasted. What more do you need?

He meant how to resolve this particular error:

Error[173] E:\PIC\BLINK.ASM 33 : source file path exceeds 62 characters (E:\SCIENCE\MICROCONTROLLER\PIC\MPLAB IDE\MCHIP_TOOLS\P16F84.INC)
 
Sorry, I just realized it's an include that's located in a path location longer than 62 characters.

You either need to reinstall MPLAB to a shorter path, or if you insist on using MPLAB in such a deep path location, you need to move the include files to a shorter one. I would simply reinstall MPLAB to "\Program Files\Microchip". With MPLAB 7.2, the includes end up in "\Program Files\Microchip\MPASM Suite".
 
Joel Rainville said:
Sorry, I just realized it's an include that's located in a path location longer than 62 characters.

You either need to reinstall MPLAB to a shorter path, or if you insist on using MPLAB in such a deep path location, you need to move the include files to a shorter one. I would simply reinstall MPLAB to "\Program Files\Microchip". With MPLAB 7.2, the includes end up in "\Program Files\Microchip\MPASM Suite".

or if you do not wish to reinstall it..copy all the include files (you get this option when you make a project file) in a seperate folder (C:\projects\).
 
Electrix said:
Joel Rainville said:
Sorry, I just realized it's an include that's located in a path location longer than 62 characters.

You either need to reinstall MPLAB to a shorter path, or if you insist on using MPLAB in such a deep path location, you need to move the include files to a shorter one. I would simply reinstall MPLAB to "\Program Files\Microchip". With MPLAB 7.2, the includes end up in "\Program Files\Microchip\MPASM Suite".

or if you do not wish to reinstall it..copy all the include files (you get this option when you make a project file) in a seperate folder (C:\projects\).

Good idea, but keep in mind that if you later update MPLAB, the newer include file might contain bug fixes/enhancements that you will not get unless you copy it again from MPLAB's folder to your project's. I would try to get a proper, clean MPLAB installation first, if at all possible.
 
Joel Rainville said:
Sorry, I just realized it's an include that's located in a path location longer than 62 characters.

You either need to reinstall MPLAB to a shorter path, or if you insist on using MPLAB in such a deep path location, you need to move the include files to a shorter one. I would simply reinstall MPLAB to "\Program Files\Microchip". With MPLAB 7.2, the includes end up in "\Program Files\Microchip\MPASM Suite".
You can do that, but it is better to use Linker and it's COFF file format (instead of COD), which doesn't have such limitation.
 
Jay.slovak said:
Joel Rainville said:
Sorry, I just realized it's an include that's located in a path location longer than 62 characters.

You either need to reinstall MPLAB to a shorter path, or if you insist on using MPLAB in such a deep path location, you need to move the include files to a shorter one. I would simply reinstall MPLAB to "\Program Files\Microchip". With MPLAB 7.2, the includes end up in "\Program Files\Microchip\MPASM Suite".
You can do that, but it is better to use Linker and it's COFF file format (instead of COD), which doesn't have such limitation.

Would checking the "Suppress COD-file generation" option in the MPLINK tab of the project's Build Options be enough?
 
I used to think that using a microcontroller will make things easy for me but i've discovered that learning to develop a microcontroller-based circuit could be more involving. one have to buy programming kits, get softwares, resolve installation problems, learn to write programs, get the program to work then you have to design the main circuit. its a whole lot of work!
 
folarinv said:
I used to think that using a microcontroller will make things easy for me but i've discovered that learning to develop a microcontroller-based circuit could be more involving. one have to buy programming kits, get softwares, resolve installation problems, learn to write programs, get the program to work then you have to design the main circuit. its a whole lot of work!

What's fascinating about microcontrollers is that it's a perfect mix of hardware and software, and you need knowledge of both parts to be able to do something useful with it. There is no abstraction keeping the low-level details from you. It all has to be learned.

That's why most electronics guys get stumped a while on the software part, while software guys like me have to spend months to learn simple basic circuitry (provided you have some electrical knowledge first!). It is a very complex and broad field, that once you master, will probably make your life as a designer way easier.
 
Joel Rainville said:
The first column is reserved to labels, like "Main" in your case.

Here's the last error message after some modify:Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "E:\MPLAB IDE\MCHIP_Tools\mpasmwin.exe" /q /p16F84A "BLINK.asm" /l"BLINK.lst" /e"BLINK.err"
Message[301] E:\MPLAB IDE\MCHIP_TOOLS\P16F84.INC 37 : MESSAGE: (Processor-header file mismatch. Verify selected processor.)
Error[113] E:\PIC\BLINK.ASM 7 : Symbol not previously defined (XT_OSC)
Error[118] E:\PIC\BLINK.ASM 17 : Overwriting previous address contents (0000)
Error[118] E:\PIC\BLINK.ASM 17 : Overwriting previous address contents (0000)
Warning[207] E:\PIC\BLINK.ASM 20 : Found label after column 1. (Main)
Message[302] E:\PIC\BLINK.ASM 22 : Register in operand not in bank 0. Ensure that bank bits are correct.
Halting build on first failure as requested.
BUILD FAILED: Tue Sep 20 18:45:49 2005



What's wrong with the column after Main as you say, i can't understand that..

and what have I do with this error message especially about CONFIG line...i'm really a little confused! :roll:






Joel Rainville said:
Look a code templates that come with MPLAB if you want to see quickly how an actual ASM source code file should look like.

Ok,I'm going to do that and read MPLAB help file to clarify some of the program!! what's your opinion my friends...

With all my respect to you all :)
 
4electros said:
Executing: "E:\MPLAB IDE\MCHIP_Tools\mpasmwin.exe" /q /p16F84A "BLINK.asm" /l"BLINK.lst" /e"BLINK.err"

This line tells me you are using a 16F84A, compiling a BLINK.asm file for it. Let's look at the errors:

Message[301] E:\MPLAB IDE\MCHIP_TOOLS\P16F84.INC 37 : MESSAGE: (Processor-header file mismatch. Verify selected processor.)

MPASM/MPLAB is telling you that you are using the wrong header file. You included the header for the non A version of the 16F84... Which one are you actually using?

Error[113] E:\PIC\BLINK.ASM 7 : Symbol not previously defined (XT_OSC)

XT_OSC is not a valid configuration flag. There's a typo in it. Look it up in the header.

Error[118] E:\PIC\BLINK.ASM 17 : Overwriting previous address contents (0000)

It sounds like you are not using a memory address properly, but I'd have to have a look at BLINK.ASM, line 17 to see exactly what's going on...

Warning[207] E:\PIC\BLINK.ASM 20 : Found label after column 1. (Main)

It looks like you just blindly put blank spaces everywhere in your source file. "Main" is a label, it should really stay in column 1, without any blank spaces before it.
 
Joel Rainville said:
That's why most electronics guys get stumped a while on the software part, while software guys like me have to spend months to learn simple basic circuitry (provided you have some electrical knowledge first!).
The same goes with me except that i don't have good knowledge about software as you ...but the problem with software is that it takes too much time to learn only, it's a matter of time only!

Concerning to hardware and circuitry i have a big problem is that i can't handle the solder with more flexibility i don't know which are the best instruments that guaranttee to build nice ciruit and how to use it in best ways ! can anyone advise me or give me his viewpoint about that?!

in addition to that i don't know how to select the best componenets in my circuit diagram (ex. pic programmer)

Are you bored of me! I hope that's false :?
 
Joel Rainville said:
MPASM/MPLAB is telling you that you are using the wrong header file. You included the header for the non A version of the 16F84... Which one are you actually using?

Error[113] E:\PIC\BLINK.ASM 7 : Symbol not previously defined (XT_OSC)

XT_OSC is not a valid configuration flag. There's a typo in it. Look it up in the header.

What's about the header file i don't understand what's it about, and how to deal with this problem?!
 
P16F84.INC == Include File == Header File

Open that file, and look for something that's very similar to "XT_OSC".

Or compare the "XT_OSC" flag to the other ones in your code... It's quite obvious what the typo is!

Also, is your PIC a 16F84 or 16F84A? Each one has its own header file. Guess what they are called...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top