Code verification errors 16F1847


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,631


    Did you find this post helpful? Yes | No

    Default Re: Code verification errors 16F1847

    data sheet page 82


    8.5 Automatic Context Saving
    Upon entering an interrupt, the return PC address is
    saved on the stack. Additionally, the following registers
    are automatically saved in the Shadow registers:
    • W register
    • STATUS register (except for TO and PD)
    • BSR register
    • FSR registers
    • PCLATH register
    Upon exiting the Interrupt Service Routine, these
    registers are automatically restored. Any modifications
    to these registers during the ISR will be lost. If modifications
    to any of these registers are desired, the
    corresponding shadow register should be modified and
    the value will be restored when exiting the ISR. The
    shadow registers are available in Bank 31 and are
    readable and writable. Depending on the user’s
    application, other registers may also need to be saved.
    Warning I'm not a teacher

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Code verification errors 16F1847

    Are you sure you’ve changed the destination device in the project from the 18F to the 16F part?
    The only reason I can think of to blame software being written to the device for the device not programming, is writing invalid data to the device.

    16F devices have a 14 bit instruction set, and 18F have 16 bit instruction set. That’s not a hard rule, but generally true.
    Given that it’s chopping one of the upper two bits off, that’s suspicious.
    The first example you gave looks like a specific subtract instruction op code that is not supported with 16F.
    They both have subtract instructions, but the 16F can’t subtract from RAM, and load the destination in a single instruction.

    I’m a little baffled though because I wouldn’t expect an 18F hex file to be able to load in the programmer software when a 16F part is selected or detected.
    Just in case, why not read the program hex from he 18F part and try to load that straight to the 16F part to check the result?
    Last edited by Art; - 27th April 2018 at 18:01.

  3. #3
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    116


    Did you find this post helpful? Yes | No

    Default Re: Code verification errors 16F1847

    Thanks Richard and Art,

    I found the Automatic Context Saving info in the data sheet after refining the search criteria, that's a lesson learned first up.

    The MeLabs website mentions paid upgrades but I don't see anything for free even if a licenced owner (I am) - I've emailed Charles Leo for clarification but he's overworked so not expecting a reply soon.

    Art, there's some confusion with your last paragraph - I'm not loading an 18F hex file into a 16F part, both are different programs with different resulting hex files except the 18F programs the chip without any problems and runs on a breadboard faultlessly. The 16F programs but suffers those verification checks. As mentioned, the only changes are those concerning the DTInt's files differences between the two families.

    I'm looking into upgrading MPASM to see if it changes things - what should I be looking for? The only reference I have to go by is I see on my laptop \PBP3\MPLAB\MPLAB Tools v8.85.msi that I can't remember installing... I'm assuming the MPASM v5.45 I see at the top of the compile box came from the msi install - or am I wrong? Is it MPLAB X I need to download and install or am I completely missing the plot here?

    On another tack, if I buy an upgrade does it include the appropriate version of MPASM? If not, how does one ever know when or what version of MPASM is needed? Confusion reigns.

    Thanks and regards,
    Bill

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,631


    Did you find this post helpful? Yes | No

    Default Re: Code verification errors 16F1847

    its all there on the melabs web site
    http://pbp3.com/download_legacy.html
    Attached Images Attached Images  
    Warning I'm not a teacher

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Code verification errors 16F1847

    I have used a few of these 16F1847's to replace a few old 16F628's on a couple of REAL OLD projects... They work a treat...
    Dave Purola,
    N8NTA
    EN82fn

  6. #6
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    116


    Did you find this post helpful? Yes | No

    Default Re: Code verification errors 16F1847

    Hi Richard,

    Charles also responded to my email and provided the same information, thanks to both of you although I'm still wondering why I couldn't find that info myself.

    I downloaded and installed MPLABX, checked the appropriate box in the program options and recompiled the code for the 16F1847 (MPASM v5.77 now indicated). I am now greeted with error messages (not there when MPASMX unchecked):
    "Message[303] C:\PBP\BILL'S RETIC.ASM 1191 : Program word too large. Truncated to core size. (5761)"
    followed by another 77 lines of the same but with end number changes.

    Does this mean the chip program space is not big enough? It compiles to 7789 words used while the 18F2620 compiles to 14146 bytes.

    While I'm here... how does one capture/copy the results messages? I appear to highlight it (turns black) but ^c has no effect.

    Thanks for your patience and sharing of knowledge.

    Kind regards,
    Bill

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,631


    Did you find this post helpful? Yes | No

    Default Re: Code verification errors 16F1847

    "Message[303] C:\PBP\BILL'S RETIC.ASM 1191 : Program word too large. Truncated to core size. (5761)"
    followed by another 77 lines of the same but with end number changes.

    Does this mean the chip program space is not big enough? It compiles to 7789 words used while the 18F2620 compiles to 14146 bytes.

    it sounds more like a calculated jump or memory offset has gone out of limits, maybe if you post the entire error message
    but sometimes the clues are pretty vague




    While I'm here... how does one capture/copy the results messages? I appear to highlight it (turns black) but ^c has no effect
    its not quite a clean copy though
    Attached Images Attached Images  
    Warning I'm not a teacher

Similar Threads

  1. 16F1847 Usart and I2C
    By Seahound1 in forum Serial
    Replies: 6
    Last Post: - 18th December 2012, 20:41
  2. Replies: 3
    Last Post: - 1st July 2008, 21:07
  3. DTMF verification
    By lerameur in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st May 2008, 23:28
  4. Data verification
    By Daniel Simões in forum Serial
    Replies: 5
    Last Post: - 26th August 2006, 02:59
  5. Timing verification.
    By Dwayne in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st August 2004, 15:44

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