What is Bootloader?
Bootloader is a small code which stays inside MCU flash. It is used as programming tools, to load real program code into the MCU.
Real program code canbe passed from PC to bootloader by specific PC application ("mikroBootloader USB HID") over specific communication interfaces.
USB HID Bootloader
This bootloader communicates with PC over USB HID inteface by using mikroC bootloader protocol. It is designed to work in conjunction with mikroC's 'USB HID Bootloader'
In this Project I will show you ,how to program USB HID Bootloader in to PIC18F2550 & PIC18F2550.
And upload a simple blink program into the PIC via USB Bootloader.
In this project I will use a PIC18F2550 & PIC18F2550.This have a USB communication.
The code I am using is a example code of MikroC's.
You can find it in the example folder of MikroC.I modified it so it can work with 4Mzh crystel and other thing.
It can work with other crystal.You have to make a own code for that.
This project is for those ,who has minimum skill of PIC MCU & know something about code(blink a light i think is minimum skill).
1. Upload the "USB HID Bootloder" code in to the PIC with a PIC Programmer.
The circuit diagram is like this.Place the PIC.
2. The program we will use to transfer the compiled code to MCU is MikroC's
"mikroBootloader USB HID".You can find it in MikroC programs>Tool.
3. Connect the USB cable.Open the program.The usb symbol of the program will be red.You can also hear a sound.Browse the Hex.Select the Hex.Click uplode.
4. You will hear a sound.and a massage box telling "The MCU is restarting".
5. The connected light in PORTB0 will blink.
* You can upload any program/code to PIC. Like plug>uplode>reset.Good to go.
* It can work on PIC18fxxxx chip which has a USB.I think PIC24 could do it.You have to modify it.
But not the 12F,16F.
* No programmer need to upload the code.You need programmer once to program "USB HID
Bootloder" code in to the PIC.
* Works on WinXP/7/8/10.
* Driver installs automatically.(I am using windows 10 pro)
* The crystal must be same in "USB HID Bootloader" code & your code.(If you want other crystal you need to set that in MikroC's project editor.)
* If you wanted to make "USB HID Bootloader" code for another MCU,you need a MikroC lisence.
Because free version can't compile more than 2kb. Shows a "Data limit" massage.But
"USB HID Bootloader" code is more than 10kb.
* After the usb cable is connected you need to open the "mikroBootloader USB HID" program within 5 second.After 5 second the PIC reset automatically & run the old program .
* After uploading the code you need to reset the PIC.
* You have to set circuit same as picture.The capacitor must be same as shown.
* The project setting in MikroC project edit will configure as the picture.
* The USB Bootloader Driver will be installed automatically.
* It tasted in PIC18F2550 & PIC18F2550.
* The circuit and other component must be need to work usb communication(expect led).
* It dose not work with proteus as showing CPU over load.
* Your code's configuration ,like crystal ,usb power etc in "Tools>Edit project" must be same as bootloder code configuration.
* If is not working,try to restart PC,program the MCU again,check usb wire connection ,crystel,
capacitors value.Make a permanent PCB to avoid lose connection.
You can find "USB HID Bootloader" code,hex,"mikroBootloader USB HID" program,Circuit & picture etc in that folder.In this folder you can find code for both PIC18F2550 & PIC18F2550.