18F4550 USB HID Bootloader

Post your requests and ideas on the future development of mikroC PRO for PIC.
Post Reply
Author
Message
kapil123
Posts: 9
Joined: 23 Jun 2014 19:23

18F4550 USB HID Bootloader

#1 Post by kapil123 » 23 Jun 2014 19:34

Hello All,
I am new to PIC. To learn the PIC microcontroller I want to burn a bootloader to 18F4550. As for the beginner, I think I must use bootloader instead of ISP programmer. There are many posts, but no one share the exact configuration setting for 18F4550. How can I change the configuration for the 18F4550 ( I am very new to this world), even the USB HID bootloader for 18F2550 is given in example code. Can you share the hex code or the respective files with correct setting.

Regards
Kapil

User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: 18F4550 USB HID Bootloader

#2 Post by petar.timotijevic » 25 Jun 2014 14:55

Hi Kapil and welcome to the MikroE forum,

Please see attachment for PIC18F4550 and PIC18F2550 USB HID Bootloaders.

PIC18F4550 - 8MHz crystal
Folder: \Project\PIC18F

PIC18F2550 - 8MHz crystal
Folder: \Project\PIC18F

Configuration you can see in Project settings.


Best regards,
Peter
Attachments
HID Bootloader PIC18F2550.zip
HID USB Bootloader PIC18F2550 8MHz Crystal
(548.66 KiB) Downloaded 1806 times
HID USB Bootloader PIC18F4550 8MHz Crystal.zip
(543.93 KiB) Downloaded 2820 times

kapil123
Posts: 9
Joined: 23 Jun 2014 19:23

Re: 18F4550 USB HID Bootloader

#3 Post by kapil123 » 26 Jun 2014 05:13

Thank you for your support. When I open this project file in my friend's computer the frequency shows 38 MHz but you mention 8MHz. Which one is correct? When I change the frequency to 8MHz the hex code will generated; This hex file I will use? or other settings are required?

Thanx.

User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: 18F4550 USB HID Bootloader

#4 Post by petar.timotijevic » 26 Jun 2014 08:40

kapil123 wrote:Thank you for your support. When I open this project file in my friend's computer the frequency shows 38 MHz but you mention 8MHz. Which one is correct? When I change the frequency to 8MHz the hex code will generated; This hex file I will use? or other settings are required?

Thanx.
Hi Kapil,

MCU frequency is 48MHz not 38MHz or 8MHz, and there is no 38MHz in project settings. 8MHz is crystal which is used with PLL to form 48MHz.


Best regards,
Peter

kapil123
Posts: 9
Joined: 23 Jun 2014 19:23

Re: 18F4550 USB HID Bootloader

#5 Post by kapil123 » 04 Jul 2014 17:05

Hello, Thank you for your replies. As this is my first project and after this I will learn the PIC. As attached program, I am confused with the settings. Can you share the hex code for the PIC 18F4550 USB hid Bootloader for 8MHz external crystal. Can you suggest me any good tutorial for the basics of mikroc for PIC. How to compile the code and settings etc ?

Thanks.

User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: 18F4550 USB HID Bootloader

#6 Post by petar.timotijevic » 07 Jul 2014 07:09

Hi,

Please see my attachments in this topic, you can find complete project files including hex files, source code, project settings,...

Also please see our publications here:
http://www.mikroe.com/categories/view/4/publications/


Best regards,
Peter

szacpp
Posts: 61
Joined: 19 Sep 2015 21:31

Re: 18F4550 USB HID Bootloader

#7 Post by szacpp » 22 Nov 2015 17:27

hi petar.timotijevic
Can I use 20MHz crystal with above configuration?

User avatar
biljana.nedeljkovic
mikroElektronika team
Posts: 1043
Joined: 30 Jun 2015 15:15

Re: 18F4550 USB HID Bootloader

#8 Post by biljana.nedeljkovic » 25 Nov 2015 11:38

Hello,

you have to change configuration settings if you use different oscillator.

Please take a look at the datasheet for the microcontroller you want to use, and look up the clock diagram to set the prescale factor properly.
http://ww1.microchip.com/downloads/en/D ... 39632e.pdf

Best regards,
Biljana Nedeljkovic

jeovanevs
Posts: 1
Joined: 18 Jun 2023 22:52

Re: 18F4550 USB HID Bootloader

#9 Post by jeovanevs » 18 Jun 2023 23:07

petar.timotijevic wrote:
26 Jun 2014 08:40
kapil123 wrote:Thank you for your support. When I open this project file in my friend's computer the frequency shows 38 MHz but you mention 8MHz. Which one is correct? When I change the frequency to 8MHz the hex code will generated; This hex file I will use? or other settings are required?

Thanx.
Hi Kapil,

MCU frequency is 48MHz not 38MHz or 8MHz, and there is no 38MHz in project settings. 8MHz is crystal which is used with PLL to form 48MHz.


Best regards,
Peter
Hi for all those who come here someday.
The PIC18F4550 works with a frequency multiplier, which adjusts the frequency for USB. CPU and USB can work with different clocks. USB High Speed needs a fixed frequency of 48MHz. Using an 8MHz crystal this frequency is adjusted to 48MHz. The CPU can work with this frequency or a lower one, when using a frequency prescaler. More information can be found in the datasheet. That's why the comment is talking about an 8MHz crystal and an operating frequency of 48MHz, that is, the USB and the CPU are operating at the same frequency.
In mikroC this is adjusted in the project settings.

Best regards,
Jeovane.

Post Reply

Return to “mikroC PRO for PIC Wish List”