585,568 active members*
3,644 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2007
    Posts
    4

    linker question

    Hello, I am relatively new to programing pics but I have MPLAB and PIKIT1 Classic and can easily program (assembly) and control I/O on a 12f675 which is great but here is my problem: I have been using the linker file in my projects on the 12f and tried moving up to a 16f684 and when I include the linker file (recommended in the MPLAB manual, using the project wizard) I constantly get a "cannot fit ORG 0x000" error when I try to build it. This is a Linker error according to the build screen. I have even tried this with the supplied code template from Microchip so I don't think my code is at fault. I finally asked on another forum about this and they said to do away with the linker file in my project, or modify the linker file which is beyond my capability right now. So I did away with the linker file and it assembles ok but the chip seems to act erratically, unlike the 12f675. My question is, do I or don;t I need to use a linker file with these? I tried to research this topic until I get so confused I get no where. Thanks for any and all help on my problem.

  2. #2
    Join Date
    Jan 2007
    Posts
    4
    I cannot stand it any longer. Is this question too dumb or does no one know? I am a beginner so please have mercy.

  3. #3
    Join Date
    Dec 2003
    Posts
    24220
    If you down load the Assembler/Linker manual it gives examples as to what is happening and how to get rid of it.
    I ran into that the first time I used it, your program probabally can be compiled without the Lkr file, but in this instance you need to edit the Linker file, get rid of the NAME=vectors line and change the NAME=page start to 0x0000
    If you are not using the interupt vector section.
    Like I mentioned, they give a detailed example in the MPlab manual.
    Al.
    also remove the SECTION NAME=STARTUP ROM=vectors line for now.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  4. #4
    Join Date
    Dec 2003
    Posts
    24220
    Also remember you can edit the ASM and LNK files on the fly after a faulty compile simply by double clicking on the file drop downs on the Left side of the screen.
    Then simply re-compile by the Build-ALL on the tool bar.
    Make sure you always tick the 'copy files' box when you identify linker files etc as this retains the original, also when you edit the linker file, instead of removing a line, just put // in front of anything to ignore.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  5. #5
    Join Date
    Jan 2007
    Posts
    4
    Thank you Al, I will download the manual immediately. I didn't catch the part about copying the files at first, and THAT was confusing. I re-read the manual several times and finally found out what was going on. I have a lot to work on, I appreciate your adivse.

Posting Permissions

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