LOADER_USED question


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2007
    Posts
    10

    Default LOADER_USED question

    From what I gather, #defining LOADER_USED will cause PBP to offset where it starts putting code by 4 words. I can't really verify that because I'm not sure where it's defined for the 16f series of MCUs (pbppic16.lib doesn't exist). So, empirically that seems to be the case anyway.

    If the point of LOADER_USED is to leave the first four words available for the bootloader, why then does it insert a "GOTO 0x04" at location 0x0000? Am I misunderstanding something? That seems like it would clobber whatever GOTO the bootloader will have put into 0x0000.

    Thanks,
    Kevin

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    pbppic16.lib doesn't exist
    There is no pbppic16.lib. For the 14-bit core the library is pbppic14.lib

    Scroll down below the utility macros and look in the "Startup Code" section.

    why then does it insert a "GOTO 0x04" at location 0x0000?
    Because it needs to vector the the INIT location to process startup code
    that didn't fit between 0x00h and 0x03h.

    Scroll way down to the bottom of your pbppic14.lib, and look in the INIT
    section.

    The PC boot-loader software normally just re-maps whatever user code it
    finds after its own jump vectors, so this normally isn't a problem.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Jan 2007
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Thanks for that info. I actually had discovered that pbppic14.lib was being used when looking at the resultant ASM, but your explanation clarifies why.

    So, now I guess I need to decide whether I want to GOTO my bootloader immediately after all the PBP init code or whether I want to modify the .lib file to remap as appropriate. I'm thinking the latter might make more sense as I develop other programs relying on my bootloader. Either way, I have enough info to really get this done now, I think.

Similar Threads

  1. ADCIN question
    By Greg McFadden in forum General
    Replies: 4
    Last Post: - 16th September 2008, 02:53
  2. AN Question for "word" variable read The serial port
    By redfoen in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th December 2007, 17:39
  3. Remote PIC input question
    By Adrian in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st September 2007, 15:44
  4. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  5. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49

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