Where is the bootloader ?


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Where is the bootloader ?

    Nah the link is working... things just changed a little bit.

    MicroChip USB Framework is a HUGE collection of ready to go and compile code example.... and an excellent source of knowledge. EVERYBODY should have it somewhere in their computer. Sure enough it's a massive package.

    Now the latest USB Framework is merged with other Microchip ressources in a single package called Microchip Application Library.

    Originally, the USB Bootloader have been made for the PICDEM USB board.

    You may also need to download their C18 compiler in case the .HEX file for your specific PIC is not included in the USB Framework.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Dec 2004
    Location
    Scarborough UK
    Posts
    77


    Did you find this post helpful? Yes | No

    Default Re: Where is the bootloader ?

    Henrik, the link only works for me if I right-click and select open in new window ?, very strange.

    mister_e, ok thanks for that, I would never have found this package if you hadn't told me about it, the microchip website has nothing that indicates to me where to find the bootloader, anyways, I have downloaded the package and found the bootloader for my device already as a hex and I've made some progress.
    I have programmed the bootloader into my device and it is recognised by the PC bootloader program and I can use it to put my main program into the device.

    Next problem, I dont know how to switch between bootloader mode and running my main program ?.

    I have this line in my main program:-

    Define RESET_ORG 0x800 'To use this device with the Microchip USB Bootloader

    I noticed that it puts the bootloader portion at the beginning of memory rather than end (which I expected)

    Any ideas
    Reading the datasheet & understanding it are two different things.

  3. #3
    Join Date
    Dec 2004
    Location
    Scarborough UK
    Posts
    77


    Did you find this post helpful? Yes | No

    Default Re: Where is the bootloader ?

    Ok, I made a bit more progress, I changed "Define RESET_ORG 0x800" to "Define RESET_ORG 0x1000" and it now runs my program 'sometimes', its pretty random, after a reset sometimes it comes back up in bootloader mode and sometimes runs my program, I guess I have to find out what switches it between the two ?.
    Reading the datasheet & understanding it are two different things.

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


    Did you find this post helpful? Yes | No

    Default Re: Where is the bootloader ?

    The Microchip USB loaders are configured to run on Microchip USB dev boards and they use SW2 to determine if it jumps to the loader or user code at POR. In the USB loader version I have, io_cfg.h has SW2 defined as the switch used to toggle between loader & user mode.

    #define sw2 PORTAbits.RA3 // this means RA3 is the switch input pin

    In main.c they sample this switch at power up to determine the mode;
    Code:
        //Check Bootload Mode Entry Condition
        if(sw2 == 1)       // use sw2 to determine if the device should enter the bootloader, or main app code
        {
          ADCON1 = 0x07;   // Restore "reset value" of the ADCON1 register
          _asm
             goto 0x1000   // If not bootloader, go straight to the main application remapped "reset" vector.
          _endasm
       }
    So if RA3 = 1 at power up it jumps to your code. If RA3 = 0 it enters boot-loader mode. If RA3 is floating on your board that would explain why it's a hit & miss at POR since the input may be read as either high or low when floating.

    Note the goto 0x1000. This is where your code should start. Older versions started at 0x800.
    Last edited by Bruce; - 19th September 2011 at 14:46.
    Regards,

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

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