+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Junior Member level 1
    Points: 487, Level: 4

    Join Date
    Jun 2017
    Posts
    16
    Helped
    0 / 0
    Points
    487
    Level
    4

    mplab 8.92 compilation error

    hello Guys

    few years ago i was using MPLAB 8.92 to write code for 8 bit devices like 12c508
    & it was working
    but now i needed an old file to com[pile again for use but the assembler give me errors
    like directive only allowed when generating an object file

    any idea ?
    if i have to set anything before assemble it because i didnt use it since few years

    thanks in advance
    Last edited by johnny78; 22nd September 2019 at 14:51.

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 81,438, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,350
    Helped
    4456 / 4456
    Points
    81,438
    Level
    69

    Re: mplab 8.92 compilation error

    Sounds like something has reformatted the source code. MPLAB reserves the first location on a line for labels and needs at least one space before an opcode.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



    •   AltAdvertisement

        
       

  3. #3
    Junior Member level 1
    Points: 487, Level: 4

    Join Date
    Jun 2017
    Posts
    16
    Helped
    0 / 0
    Points
    487
    Level
    4

    Re: mplab 8.92 compilation error

    thanks Sir
    how to get the calibration value of the internal oscillator to move it to OSCCAL ?
    i see in my code call 0x1ff before movwf OSCCAL but when assembling it gives me error of
    "Call or jump not allowed at this address (must be in low half of page"

    i think i have a problem with the calibration of the oscillator

    thanks for help
    Last edited by betwixt; 22nd September 2019 at 23:04. Reason: removed duplicate paragraphs



    •   AltAdvertisement

        
       

  4. #4
    Super Moderator
    Points: 81,438, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,350
    Helped
    4456 / 4456
    Points
    81,438
    Level
    69

    Re: mplab 8.92 compilation error

    OSCCAL only adjusts the oscillator slightly and it won't stop your code running even with silly values in it. If you are seeing a misbehaving program, other than something very critical of timing, OSCCAL probably isn't the problem.

    Resetting the calibration used to be easy with the Pickit2 programmer but the facility was removed in later versions. I'm sure if you search there will be a program that does it for you but you would probably need a reference oscillator to compare its speed against. When programming devices with a calibration register in future, either read the old value before reprogramming and then put the value back again or try to avoid overwriting the OSCCAL value.

    Note that you don't normally jump or call to the last byte in memory where the value is saved. The reset vector is normally set to that address and the instruction there loads W with the value so when the address advances it rolls over to 0x000 with the calibration value in W.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



--[[ ]]--