Code verification errors 16F1847


Closed Thread
Results 1 to 26 of 26

Hybrid View

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

    Default Code verification errors 16F1847

    Hi All,

    I have written a program developed on an 18F2620 and then ported across to a 16F1847 using 7786 words of program space. It uses DTInt's, a rotary encoder (menu selection) and a Nokia 3310 display with its include "LCD_3310v32 WJS.inc" (has some edited characters).

    The 18F has no problems programming or verifying and runs correctly but with the 16F it programs okay without any errors (only page boundaries warnings) however fails verification always at the same locations e.g. "code verify error at 11BC. 1761 should be 5761" and "11BD 3465 should be 7465", "11BE 3244 should be 7244", "11BF 2179 should be 6179", etc,. I notice there is always a 4xxx difference between the numbers but don't know the significance. I've tried different hardware programmers (both faultless on every other task) with same results and multiple (new) 16F1847 to no avail.

    The only differences made to the program are to change DTInt's Include files from the 18 version to the 14 version and add the wsave line. I have already manufactured and populated the pcb to take a DIL18 else would just use the skinnydip 28 and be done with it - making an adapter is clumsy and brings height issues with it so I'd like to find and fix the problem.

    I don't have any other 8k DIL18 16F PICs to try in place of the 16F1847. I'm using PBPX 3.0.6.4 and MCSP 5.0.0.5 with MPASM (where do I find what version of MPASM the compiler is using?).

    Can somebody offer any advice on the verification problem or suggest the next thing to try?

    Kind regards,
    Bill

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: Code verification errors 16F1847

    I'm using PBPX 3.0.6.4
    why ?

    3.010.4 is the latest freely available version of pbp3.0


    The only differences made to the program are to change DTInt's Include files from the 18 version to the 14 version and add the wsave line
    that chip has auto context save Wsave is not necessary and could cause errors



    (where do I find what version of MPASM the compiler is using?).
    see below
    Attached Images Attached Images  
    Warning I'm not a teacher

  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

    Hi Richard,

    Thanks for your help.

    I remarked the wsave but it made no difference, I still have the exact same verification issue. I see I'm using MPASM 5.45 when compiling - is this the cause?

    I did a search for 'wsave' and 'auto context saving' in the 16F1847 data sheet but nothing found - please enlighten me so I can check before using again on different chips.

    As to the version of PBP3 I'm using... is it freely available or is it a purchased upgrade? I'm trying to hold off as long as I can (money's tight, I'm out of work) before paying out again unless I really need to.

    Kind regards,
    Bill
    (in Perth)

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


    Did you find this post helpful? Yes | No

    Default Re: Code verification errors 16F1847

    I did a search for 'wsave' and 'auto context saving' in the 16F1847 data sheet but nothing found
    hi bill
    basically any chip that has auto context saving requires no additional code/vars to save the context, for the priority interrupt anyway.
    wsave psave fsave... are a legacy of old chips .

    As to the version of PBP3 I'm using... is it freely available or is it a purchased upgrade?
    its free upgrade for licenced pbp3 users, you are quite a few versions behind ditto for mpasm . it may be the issue.
    but it won't hurt to upgrade
    Warning I'm not a teacher

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    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

  6. #6
    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 19:01.

  7. #7
    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

  8. #8
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    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

Similar Threads

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

Members who have read this thread : 1

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