bootloader that xfers code from I2C into program memory


Results 1 to 31 of 31

Threaded View

  1. #24
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: bootloader that xfers code from I2C into program memory

    You get something wrong, probably because my bad English
    Constant BLOCK_SIZE is defined in microchip MPLAB, and doesn't have anything with PBP. So PBP compiler won't be aware of BLOCK_SIZE and will throw an error.
    (And I can't remember where I found it, I think it was used in some PBP lib file)

    [EDIT]BLOCK_SIZE is defined in includes that are located at PBP3\DEVICES. But this is ASM level include as far as I know. It is just added to .lst file after compiling. So compiler isn't aware of this file.[/EDIT]

    But if you use it in ASM, compiler will just forward your ASM line to .LST file. And .LST file will be assembled into ASM and then in HEX file.
    So to be clear(or try to be), BLOCK_SIZE is in assembler include, BlockSize is any variable in PBP preferably in BANKA.
    There is two way, one I used is to move constant to variable in ASM, and other is similar to yours, but you must use EXT to tell PBP compiler that your constant is declared somewhere else, but assembler can reach it.
    That should look like this
    BLOCK_SIZE CON EXT
    BlockSize VAR BYTE
    BlockSize=BLOCK_SIZE
    But then you don't need variable BlockSize, because you can use constant BLOCK_SIZE.
    I didn't try this, I just know what I learned from Darrel's post about EXT.

    To pass variable from main app to bootloader, variable doesn't have to be in any specific bank, it must be at specific address.
    In main app:
    VarAtAdr50 VAR BYTE 50 'This is variable declared at decimal address 50
    ....
    VarAtAdr50=10
    GOTO StartBootloader

    In Bootloader:
    VarAtAdr50 VAR BYTE 50
    If VarAtAdr50=10 THEN ....
    I hope that this clears things, if not can somebody else try to explain it better? Thanks, in advance.
    Last edited by pedja089; - 11th May 2016 at 23:49.

Similar Threads

  1. Program Code and Program Memory
    By DenFrod in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th February 2007, 15:51
  2. Use internal program memory like DATA memory
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th December 2006, 19:38
  3. using Flash Program Memory ?
    By muskut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th October 2006, 16:17
  4. PIC16F88, Bootloader & I2C Memory
    By digilord in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th December 2005, 16:36
  5. program memory size
    By volcane in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 25th October 2005, 20:45

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