+ Reply to Thread
Page 1 of 2
1 2 Last
Results 1 to 15 of 19

Thread: problem with MPLAB

  1. #1
    4electros Newbie
    Join Date
    Jul 2005
    Location
    Syria (country of peace)
    Posts
    383

    Default problem with MPLAB

    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!!


  2. #2
    Joel Rainville Newbie
    Join Date
    Jul 2005
    Location
    Montréal, Québec, Canada
    Posts
    730

    Default

    Everything you need to correct is stated in the orange text you pasted. What more do you need?
    Time is nature\'s way of keeping everything from happening at once.
    http://membres.lycos.fr/jrainville/

  3. #3
    Joel Rainville Newbie
    Join Date
    Jul 2005
    Location
    Montréal, Québec, Canada
    Posts
    730

    Default

    "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.
    Time is nature\'s way of keeping everything from happening at once.
    http://membres.lycos.fr/jrainville/

  4. #4
    Electrix Newbie
    Join Date
    May 2005
    Location
    PA, US
    Posts
    211

    Default

    Quote Originally Posted by Joel Rainville
    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)

  5. #5
    Electrix Newbie
    Join Date
    May 2005
    Location
    PA, US
    Posts
    211

    Default

    Quote Originally Posted by Joel Rainville
    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)

  6. #6
    Joel Rainville Newbie
    Join Date
    Jul 2005
    Location
    Montréal, Québec, Canada
    Posts
    730

    Default

    Well, it's pretty obvious, isn't it?

    And there are a lot more errors... all clearly described in the text above.
    Time is nature\'s way of keeping everything from happening at once.
    http://membres.lycos.fr/jrainville/

  7. #7
    Joel Rainville Newbie
    Join Date
    Jul 2005
    Location
    Montréal, Québec, Canada
    Posts
    730

    Default

    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".
    Time is nature\'s way of keeping everything from happening at once.
    http://membres.lycos.fr/jrainville/

  8. #8
    Electrix Newbie
    Join Date
    May 2005
    Location
    PA, US
    Posts
    211

    Default

    Quote Originally Posted by Joel Rainville
    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\).

  9. #9
    Joel Rainville Newbie
    Join Date
    Jul 2005
    Location
    Montréal, Québec, Canada
    Posts
    730

    Default

    Quote Originally Posted by Electrix
    Quote Originally Posted by Joel Rainville
    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.
    Time is nature\'s way of keeping everything from happening at once.
    http://membres.lycos.fr/jrainville/

  10. #10
    Super Moderator Jay.slovak Good Jay.slovak Good Jay.slovak Good
    Join Date
    Jan 2005
    Location
    Slovakia
    Posts
    1,740

    Default

    Quote Originally Posted by Joel Rainville
    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.

  11. #11
    Joel Rainville Newbie
    Join Date
    Jul 2005
    Location
    Montréal, Québec, Canada
    Posts
    730

    Default

    Quote Originally Posted by Jay.slovak
    Quote Originally Posted by Joel Rainville
    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?
    Time is nature\'s way of keeping everything from happening at once.
    http://membres.lycos.fr/jrainville/

  12. #12
    Super Moderator Jay.slovak Good Jay.slovak Good Jay.slovak Good
    Join Date
    Jan 2005
    Location
    Slovakia
    Posts
    1,740

    Default

    Yes, (if the linker script files are included) then it will work with long filenames.

  13. #13
    folarinv Newbie
    Join Date
    Mar 2005
    Location
    port-harcourt, nigeria
    Posts
    47

    Default

    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!

  14. #14
    Joel Rainville Newbie
    Join Date
    Jul 2005
    Location
    Montréal, Québec, Canada
    Posts
    730

    Default

    Quote Originally Posted by folarinv
    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.
    Time is nature\'s way of keeping everything from happening at once.
    http://membres.lycos.fr/jrainville/

  15. #15
    4electros Newbie
    Join Date
    Jul 2005
    Location
    Syria (country of peace)
    Posts
    383

    Default

    Quote Originally Posted by Joel Rainville
    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:






    Quote Originally Posted by Joel Rainville


    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

+ Reply to Thread
Page 1 of 2
1 2 Last

Tags for this Thread