Error when compiling- New user lots of questions


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Posts
    59

    Default Error when compiling- New user lots of questions

    Okay, so let me start by saying that I'm not a programer, I don't even play one on tv. But I'm trying to learn and here's what I've got and am trying to do. I recently purchased PicBasic Pro, MicroCode Studio Plus and I have a Microengineering Labs programmer. I've used the programmer and have programmed my chip successfully in the past using a hex file that was provided to me. I'm using the PIC 18F6520.

    I have the source code which supposedly created the hex file. I would like to play with this code and use it as a starting point for learning. So before I start to play with it, I want to successfully compile and program the source code so I have a reference point.

    I cannot guarantee that I have everything set up correctly but I think so. I did read the book that came with the Pic Basic Pro Compiler but still don't have enough information to even be considered dangerous.

    When I compile the code I get 6 error messages or actually it looks like 3 pairs of errors.
    The results says:
    Error[118] c:\progra~1\mecani~1\.....asm694: Overwriting previous address contents (0000)
    The next line states:
    Error[118] c:\progra~1\mecani~1\.....asm694: Overwriting previous address contents (0001)

    That line of code is:
    EndIf ' End If for Host or LineHead Mode


    The rest of the errors are about the same. This doesn't look like anything goofy here. So any help on what I need to be checking would be usefull.

    Thank you for your assistance with the ignorant new guy!

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hello Hylan,
    When you compile, the compiler creates a bunch of files with your file name, and different extensions. In the file with the suffix .asm you will find the instruction which is causing the error, so asm694 means the error is at line 694, since you did not post the code it is difficult to know by checking it myself, and as I do not have enough experience in assembler to answer. It will do you good to open each of those files to see what they contain. One very common error is the config fuses you set in your code conflict or try to overwrite the ones in the pic18Fxxxx (name your chip) .inc file, located in your PBP root directory. To fix that simply add an ( semicolon to the beginning of the line that says
    __config XX_OSC, & _SOMETHING & MORE_SOMETHING, save it and close it up, or leave it open until you finish compiling, afterwhich you can put it back if you desire.
    JS
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Sep 2007
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Error

    I will look at the files. I thought that the number refered to a line number, but I was looking at that line number in the original code and not the .asm file. I'll look at that closer and see if it makes more sense.

    I also have an original .asm file which is much longer than the one that was created when I tried to compile. So I am concerned that I'm not creating the same thing. Although once I can get an actual .hex file I can load and test it.

    Thank you for the help.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    i ran into similar errors when i tried to compile my first blinky program with msasm. switched to pmasm and the errors went away. i did have to change the config line for pmasm. oh and i got weird errors when i forgot to set the chip type in micro studio, it defaulted to the 16f84. not that any of that will help.

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Which assembler are you using? The question is easy, if you did not change to MPASM then the answer is PM. Those messages looked to me like MPASM errors and I treated them as such. To change assemblers, at the top of Microcode studio, click view, move down the list to Compile and Program Options and click. A window will open with 3 tabs at the top, click on assembler, there is a box marked Use Mpasm. It must be checked if you want to use mpasm, if not checked you will be using PM. Right now it is only important to know which assembler you are using, because they use different config statements, and those statements will give you a long list of errors if mixed. Check the link posted to see the differences.
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    You know ,I am not sure, but I think you have to use MPASM to program 18fxxx chips. . .
    JS
    Last edited by Archangel; - 2nd October 2007 at 06:47.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Joe, you're correct. 18Xxxxx need MPASM or i will never compile anyway.

    Let's open any 18Xxxx.INC in PBP folder..
    Code:
            NOLIST
        ifdef PM_USED
            LIST
            "Error: PM does not support this device.  Use MPASM."
            NOLIST
        else
            LIST
            LIST p = 18F452, r = dec, w = -311, w = -230, f = inhx32
            INCLUDE "P18F452.INC"   ; MPASM  Header
            ;__CONFIG    _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H
            ;__CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
            ;__CONFIG    _CONFIG4L, _LVP_OFF_4L
            NOLIST
        endif
    If you don't select MPASM, it will show you that message.

    At very least, this is one reason why i don't use PM, always MPASM. Kinda annoying stuff to switch everytime between one and the other.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. LOTS of questions....
    By reaper0995 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd March 2008, 17:00

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts