Duplicate label error


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118

    Default Duplicate label error

    Anybody seen this?

    Using a PIC18F25J50

    Trying to compile I get the following error:
    Error[115] c:\path...\testpic.asm 45 : Duplicate label ("R1" or redefining symbol that cannot be redefined)

    This is my code:
    Code:
    test:
    
          TOGGLE PORTC.0
          PAUSE 500
          GOTO test
    
    END

  2. #2
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default Re: Duplicate label error

    Sorry, I can't find the link to edit my post so will add more info here:
    I had installed PBP 2.60 and made some tests using LCD_Anypin
    Then I tried to add the 2.60C patch but could not recognize that PBP was installed indicating something about pbppic14.lib so I figured it was because this file was modified for LCD_Anypin.

    The version is not indicated on my PBP CDs but I have a previous version and an upgrade to 2.60 so I re-installed both and then tried again to add the patch and got a message about a file (don't remember which one) but I deleted it and then re-applied the patch successfully.

    A number of my previous codes was working until I applied the 2.60C patch

    Now my previous code that was ok can no longer compile.

    Getting Error [118] ...ASM 73 Overwriting previous address content (2007)

    Trying to compile this code:
    Code:
    @ __config _INTOSC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_ON & _LVP_OFF & _CP_OFF
    clear
    DEFINE OSC 8
    TRISB = 0
    TRISA = 0           
    CMCON = 7           
    OPTION_REG = 0
    INTCON = 0
    
    LCD_DB4   VAR PORTB.0
    LCD_DB5   VAR PORTB.1
    LCD_DB6   VAR PORTB.2
    LCD_DB7   VAR PORTB.3
    LCD_RS    VAR PORTA.4
    LCD_E     VAR PORTA.3
    LCD_Lines     CON 2    ' # of Lines on LCD,  1 or 2 (Note: use 2 for 4 lines)
    LCD_DATAUS    CON 50   ' Data delay time in us 
    LCD_COMMANDUS CON 2000 ' Command delay time in us 
    
    INCLUDE "LCD_AnyPin.pbp"  ; *** Include MUST be AFTER LCD Pin assignments ****
    PAUSE 500 : LCDOUT $FE,1 : PAUSE 250
    
    
    
    LCDOUT $FE,$80,"text line 2"
    LCDOUT $FE,$C0,"text line 2"
    
    
    END

  3. #3
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default Re: Duplicate label error

    Me again... Just before someone ask me to do this I have uninstalled PBP, removed the PBP folder and reinstalled from scratch.
    Setup PBP 2.50C
    Setup PBP 2.60 Upgrade
    Ran PBP 2.60C patch

    Same issues.

    Mike

  4. #4
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Cool Re: Duplicate label error

    I've seen that same error message before... I am using PBP 3.0, but I think it is telling you that you are changing the config's twice. Once in the PBP default settings for that PIC and again in your actual program.

    I think you might need to open the default include(.inc) file and remark the default configuration statement. I think??

    but then again I'm not the most experienced programmer here
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  5. #5
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default Re: Duplicate label error

    Thanks for the clue.
    Obviously since I reinstalled I had a fresh .inc file so I commented some lines and got rid of "Overwriting previous address content"
    and for the "Duplicate label ("R1"..." I found in the file P18F25J50.INC located in the \Microchip\MPASM Suite\ folder contained twice the following line in different sections line 1673 and 1733.
    Code:
    R1               EQU  H'0002'
    Commenting either one of them didn't make a difference but commenting both got rid of the error.

    I would really like to know why! (a bug in MPLAB?)

    Mike

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Duplicate label error

    R1 is the name of one of PBP's system variables.
    On the xxJ50 family, Microchip added the R1 bit name to the P*.inc files which conflicts with PBP.

    It's not really a bug in either MPASM or PBP, but it does cause some problems.

    In PBP3, new header files were created (c:\PBP3\DEVICES\*.MPASMINC) that are used instead of the normal P*.inc files.
    That allows PBP to get around the problem without making everyone edit the P*.inc files in their MPLAB installation.

    For older versions of PBP, you will still need to edit the MPASM P*.inc files like you figured out.
    -------------------

    The Overwriting Previous Address error has also been improved upon in PBP3.
    You no longer need to comment the default configs from the *.inc files. Using the #CONFIG block automatically overrides the defaults.
    DT

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