8-bit Bootloader from Microchip


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Bootloader basics.....

    Thanks Richard.

    I'm getting somehow out of the fog but I still need more info...

    2.- once the bootloader is in the chip, I must upload my programs in HEX format via serial com (if the bootloader is made for serial com) to the PIC using its hardware UART. Correct?
    not really , your hex code file data is sent by the bootloader program in a serial format to your pic using its hardware UART
    2a.- is my program (not the bootloader) going to be in HEX format or does it have to be generated in some other format?

    2b.- does it mean that once the bootloader sits inside the chip, I need a particular terminal software to upload the program into the chip or does any terminal software do the trick?



    4.- what is a software like TinyBootloader exactly doing? Is it only there to serially upload a program into the PIC or does it generate the bootloader code or what?
    see q2 , it does not make any code
    4.- what is then so "special" with this software (and all other particular bootloader software) if it is not generating or supplying the "bootloader code"? I thought it was providing THE bootloader code for some specific chip one would need.



    5.- lots of videos show the use of MPLAB to "implement" bootloaders; is it mandatory?
    The pic receiver code for bootloaders is generally asm code and compiled in mplab with mpasm , the umc bootloader is a variation
    5.- I'm using the MCS editor with MPASM compiler. As far as I now, I can (I truly can't since I don't know assembler ) insert ASM code into my PICBasic programs. If this is correct, can I copy/paste à bootloader code in MCS editor an program my chip like I would do for any other program?



    7.- would it possible to paste a bootloader code on the top of my program and flash it into the chip (like an image file for further mass programming purpose)?
    Roger

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


    Did you find this post helpful? Yes | No

    Default Re: 8-bit Bootloader from Microchip

    2a.- is my program (not the bootloader) going to be in HEX format or does it have to be generated in some other format?
    you do nothing different other than put #define loader 1 [or whatever the syntax is ]


    2b.- does it mean that once the bootloader sits inside the chip, I need a particular terminal software to upload the program into the chip or does any terminal software do the trick?
    only if you want to use and keep the b-loader , if you use another programmer the b-loader will be erased

    4.- what is then so "special" with this software (and all other particular bootloader software) if it is not generating or supplying the "bootloader code"? I thought it was providing THE bootloader code for some specific chip one would need.





    the pc part of the bootloader prgm reads the hex file and parses in into blocks to be serially transferred into the chip , the already loaded pic component of the bootloader knows how to read the data and then write it into the pic codespace when the pc component is detected
    bootloaders all do the same thing , none of them do it the same way


    5.- I'm using the MCS editor with MPASM compiler. As far as I now, I can (I truly can't since I don't know assembler ) insert ASM code into my PICBasic programs. If this is correct, can I copy/paste à bootloader code in MCS editor an program my chip like I would do for any other program?

    you only need the assembler to create the pic component , its a separate process only done once, the bootloader cares not who or what makes the hex file to be loaded

    7.- would it possible to paste a bootloader code on the top of my program and flash it into the chip (like an image file for further mass programming purpose)?
    totally unnecessary


    http://tinypicbootload.sourceforge.net/
    look at firmwares microchip pic16
    Last edited by richard; - 29th June 2020 at 09:45.
    Warning I'm not a teacher

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: 8-bit Bootloader from Microchip

    Thank you Richard.

    I'm going to have a look at the link you posted and try before asking more
    Roger

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: 8-bit Bootloader from Microchip

    Since I own MCSP (I forgot the included bootloader....), I give it a try.

    I'm using a PIC18F2431 and here is my blinky:

    Code:
    DEFINE LOADER_USED 1
    
    #CONFIG
     __CONFIG _CONFIG1H, _OSC_IRCIO_1H & _FCMEN_ON_1H & _IESO_OFF_1H
    #ENDCONFIG
    
    OSCCON  = %01100000 ' set INTRC to 4 MHZ
    
    MAIN:
        Toggle PORTA.7  ' LED
        pause 500
        goto MAIN
    END

    What did I do then?

    1.- I flashed my PIC via PICKit3 with le bootloader file from MCS ("18F2431_04.hex") and checked if it was really there; yes, it is in the PIC!
    Name:  bootloader in PIC.png
Views: 3915
Size:  77.8 KB
    ...the rest of the code is way down in the memory - but it is there!


    2.- I realised this serial programming circuit:
    Name:  prg_circuit.png
Views: 4232
Size:  16.8 KB
    My FTDI cable is plugged in my PC and is "COM3".


    3.- I launched the Loader from within MCSP and loaded my "Blinky_18F2431.hex" file previously compiled:
    Name:  loader.png
Views: 2884
Size:  20.9 KB


    4.- When I clic on "Program" in the Loader, I get following message:
    Name:  error loader.png
Views: 2854
Size:  3.7 KB


    Since I couldn't make it work, I tried to connect a button between MCLG and GND to make a "manual" reset but it doesn't help either.

    There seems to be nothing to configure in the FTDI chip to activate/deactivate the RTS pin so I admit it is working.

    Any clue what I'm doing wrong or missing?
    Roger

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: 8-bit Bootloader from Microchip

    When using the MCSP bootloader you have to understand that it is the CONFIG of the bootloader .hex file that you initially flashed into into the PIC that's "in play" and not the CONFIG in your source file. The boorloader will completely ignore whatever CONFIG you include in your source file.

    IIRC the bootloader(s) are setup for external x-tal. Your schematic indicates that you don't have one connected and your code indicates you're expecting the PIC to run on its internal oscillator - which it won't IF the bootloader dictates otherwise.

    Some PICs allows you to change primary osillator at runtime but I don't think the old 2431 is one of them.

    /Henrik.

  6. #6
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Bootloader from MicroCode Studio Plus

    Thank you so much Henrik!!!

    I adapted my code to free up the OSC pins, put a crystal and 2 capacitors and....it worked instantly!!

    May I kindly ask you how I can "create" or "modifiy" the bootloader file to adapt it to my needs please?
    Roger

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


    Did you find this post helpful? Yes | No

    Default Re: 8-bit Bootloader from Microchip

    if you own mcs plus then its in this folder / if not you won't have the build files

    C:\Program Files (x86)\Mecanique\MCSPX\MCLoader\umc\documentation

    its an adventure not worth the trip in my experience
    Warning I'm not a teacher

Similar Threads

  1. Replies: 2
    Last Post: - 28th December 2017, 15:10
  2. Replies: 0
    Last Post: - 16th March 2011, 12:58
  3. Replies: 6
    Last Post: - 5th November 2008, 11:30
  4. Microchip Bootloader and Interrupts
    By Josuetas in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 18th May 2007, 00:11
  5. Microchip TC32M Supervisory Circuit and Bootloader
    By modifyit in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 20th July 2005, 03:29

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