Working bootloader hex on 18f2550


Closed Thread
Results 1 to 22 of 22
  1. #1

    Default Working bootloader hex on 18f2550

    Ok I was looking on the web for working bootloaders for the 18f2550, I found lots of hex and tried them all until I found one that seems to do the required business....

    I put it here for anyone who wants etc
    (http://www.yorktraders.org/working2550.hex)

    I stuffed it in with winpic800 and a willem, mounted pic on a homemade PCB board with leds on all ports, connected it, and rb0 / rb1 leds flash.....

    First they flash together for a few seconds, then change to alternate flashing

    like its waiting for something, or maybe thats all it does?

    I connected it to the PC with a usb cable, and windows saw an unknown device, downloading the microchip 'pic184550 family drivers' it now shows up in device manager when I plug it into windows.

    Once connected the leds flash all the time....(together then alternate)

    So, where do I go from here to getting an 'hello world' or night rider LED demo into it ?

    Maybe this hex is not a boot loader after all but a flashing led demo!

    Seems I have my hardware problems all sorted, just dont know the next step

  2. #2
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by f_lez View Post
    Ok I was looking on the web for working bootloaders for the 18f2550, I found lots of hex and tried them all until I found one that seems to do the required business....
    I stuffed it in with winpic800 and a willem, mounted pic on a homemade PCB board with leds on all ports, connected it, and rb0 / rb1 leds flash.....
    First they flash together for a few seconds, then change to alternate flashing
    like its waiting for something, or maybe thats all it does?
    I connected it to the PC with a usb cable, and windows saw an unknown device, downloading the microchip 'pic184550 family drivers' it now shows up in device manager when I plug it into windows.
    Once connected the leds flash all the time....(together then alternate)
    So, where do I go from here to getting an 'hello world' or night rider LED demo into it ?
    Maybe this hex is not a boot loader after all but a flashing led demo!
    Seems I have my hardware problems all sorted, just dont know the next step
    Nothing to work with here... No backlink to the source site for the hex and any hints/descriptions of what the hex might do, no pictures of the schematics, LEDs, etc.
    From what I read, it sounds like what you've got is exactly what you said...some pretty flashing/blinking lights.

  3. #3

    Default

    well as it shows up in windows as a 'pic18f4550 family'' i'd presume its the original or compatible microchip bootloader.

    schemetic is simple, leds on every port.....


    Problem is most diagrams I find for it are for the 4550, so where do I connect a switch to bootload,do I need a switch to bootload?

    Why is everything bootloader for the 4550?

    seems anyone wanting to play with 2550's are getting the short end of the stick.....

    how do I generate basic that compatible with a bootloader etc.

    All this and other questions answered on the next episode of.........

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

    Default

    I modified the Microchip C18 firmware for the USB loader a while back to work with the 18F2550. I have attached it here with a simple PBP code example.

    Comments are in the PBP code for LED & switch connections. I know it works. I'm using it. If you have problems check your connections.

    I won't have time to offer tech support on using the USB loader, re-compile it for another clock speed, USB PIC, etc, etc, so enjoy, and hopefully you won't have any problems.

    You might want to download the docs for Microchips USB demo board. This explains a lot about the loader & circuits required, and how the C18 USB loader firmware works.

    If anyone wants the modified C18 USB loader files let me know. Note you will need the C18 "C" compiler if you want to make changes.
    Attached Files Attached Files
    Regards,

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

  5. #5

    Default

    Thank you so very much for the time to post this, I'll get on it at the weekend 'real work' permitting!

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

    Default

    This is the latest version 1.3 USB framework with several bug fixes. I recommend you use
    this one VS the 1st I posted.
    Attached Files Attached Files
    Regards,

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

  7. #7
    Join Date
    Feb 2008
    Posts
    2

    Default PIC18f2550 usb communication with a mobile phone

    Hi

    Im using a pic18f2550 usb port to communicate with a mobile usb....
    But im having some difficulties...
    Does the usb of the pic need to be in "master mode" to communicate with useb of the mobile phone...Please need some guidance

  8. #8
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by TD26 View Post
    Hi Does the usb of the pic need to be in "master mode" to communicate with useb of the mobile phone...Please need some guidance
    PIC's are 'slaves' only, not hosts/masters....but there are other ways around that...

  9. #9
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126

    Default

    Bruce,

    Would it be possible to get a copy of the C18 files for this firmware please. I have an application that has LEDs on a different port and just want to move them - shouldn't be that hard for me to muddle through.

    With Thanks,
    bill.

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

    Default

    Hi Bill,

    The USB framework has gone through several changes since I posted the modified loader above. Grab the newest v2.3 C18 files here;

    http://www.microchip.com/stellent/id...cName=en537044

    After you install it, Look in C:\Microchip Solutions\USB Device - Bootloaders\HID - Bootloader\HID Bootloader - Firmware for PIC18 Non-J Devices for io_cfg.h. That's the configuration header you'll need to modifiy to move your LEDs to another port.

    If you get stuck let me know. I'll help you modify it.
    Regards,

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

  11. #11
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126

    Default

    Cool, thanks Bruce.

    Downloading it now. I have an older version that I got when installing the PICDEM FS Usb board.

    Interesting its the HID bootloader, but your version appears as a custom USB device that I can program with the PICDEM FS Demo application, rather than an HID device. Maybe this newer version is a built different.


    bill.

  12. #12
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126

    Default

    Hi Bruce,

    Having some issues - Sent you a Message - you might need to log into your User Panel to see it - can't see the Private Message option on the forum anymore..

    Might be MPLAB crosseye-ness though !

    bill

  13. #13
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126

    Default Got it working !!

    I am a very happy chappie !

    I managed to recompile the bootloader to use alternative LED pins. One thing to be aware of is that there are now two bootloader codebases that Microchip provide. One is the HID bootloader, the other is one that will work with the MPUSB application.

    I tried the HID bootloader, but got some weird results, so instead modified the MPUSB bootloader which uses the custom Microchip driver. This allows me to continue to use the PICDEM FS Demo Board application to bootload my code.

    All good ! Also learned more about MPLAB and C coding than I think I ever wanted to know...

    bill.

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

    Default

    Grrrrrrrrreat! It's always good to have another tool in the toolbox huh?

    Out of curiosity... what kind of problem you got with HIDBootloader?
    Steve

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

  15. #15
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126

    Default

    Hi Steve,

    I think it was more the PC application would have some issues resetting the PIC after uploading.

    I'll have a try again when I get home as I also locked up the USB ports on my laptop by accidentally connecting the PicKit2 backwards on the ICSP header....

    Luckily they came good after a reboot and I then reflashed the board with the MCPUSB bootloader and we were away !

    I'd actually prefer to use the HID bootloader, so I will see if I can get it to work and let you all know.

    Man, the more I play with this USB stuff the more I love it !!!

    bill.

  16. #16
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126

    Default

    Just doing a bit of digging in MPLAB at luchtime and I think I know why it was not working.

    It seems the HID bootloader is a lot bigger than the MCHPUSB one. In MPLAB it uses 2040 bytes of program memory, compared with the 980 used by the MSCHUSB one.

    In my PBP code I had this :

    DEFINE RESET_ORG 800h

    statement to jump over the end of the bootloader, but for the HID version I would need to make that RESET_ORG 1000h.

    Like I said, I will try it when I get home as suddenly things make a lot more sense - I remember I was having issues with the program not working after I had bootloaded it, and then the bootloader failing - which I put down to me locking up the USB ports (which I also did).

    Like I said, I love it, but it needs a lot of brain time !!

    bill.

  17. #17
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126

    Default

    Updating the PBP code with

    DEFINE RESET_ORG 1000h ' For Microchip USB Bootloader
    DEFINE INTERRUPT_ORG 1008h ' For Microchip USB Bootloader

    Fixed the issue so I can now use the HID bootloader, which has the source for the Bootloader PC app.

    With the second DEFINE I am not sure if I require it, but I have seen it mentioned in some posts and the Microchip docs actually mention that the Interrupt vectors are moved. It also says that the High and Low priority are on two separate locations, but my code seems to work and its late.

    Tomorrow I will investigate further..

    Till then Happy Pic'n !

    bill

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

    Default

    All you need to make the new HID loader work with PBP is DEFINE RESET_ORG 1000h.

    If you're using both high-pri & low-pri interrupts, then just use the interrupt DEFINEs.

    Example:

    DEFINE INTHAND High-Pri
    DEFINE INTLHAND Low-Pri

    PBP will automatically take care of it for you with ORG RESET_ORG + 8 for the high priority
    jump, and ORG RESET_ORG + 18h for the low priority jump.

    At 0x1008 PBP inserts GOTO High-Pri, and at 0x1018 GOTO Low-Pri.

    If you're not using interrupts all you need is the DEFINE RESET_ORG 1000h.
    Regards,

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

  19. #19
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126

    Default

    Bruce,

    I have DT_Int running, so will these commands still be needed ? Not sure if it adds these automagically.

    bill.

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

    Default

    Hi Bill,

    All you need is the DEFINE RESET_ORG 1000h. If you look in the DT_INTS-18.bas file,
    you'll see where it's already including the int handler DEFINEs for high & low int handlers.

    So PBP will still place the correct int vector offsets in there automagically for you.
    Regards,

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

  21. #21
    saochu's Avatar
    saochu Guest

    Default thanks all

    i reading and thanks to all some one !

  22. #22

    Default

    ok now i have the hex in the pic, and when i connect it to the PC I get a ding-dong, it says its a unknown device...

    I guess the fuses were wrong for my xtal so in my programmer software i changed the divider from the old 20mhz crystal to the setting for my 4mhz one.


    now when i connect it says there's a pic device blah blah, and the pic starts 2 leds flashing....

    looks like a worker to that point...

    so I have my own (from the USBCDCDEMO) program I want to put on the pic, obviously after the boot loader, so I have a define reset org1000h

    But, when i compile and a get a lovely .hex file to program, how do i program it into the pic.....

    I must need some utility on the pc to load and blow the .hex file...

    And, do we have one that can work with microcode studio and take the .hex file as a command-line parameter and blow the hex, or is it going to have to be an awful standalone program etc that requires 768 mouse clicks....... (like the ql200 software seems to)

    Looks like i am still were i was when i made the first post 2 years ago lol
    Last edited by f_lez; - 19th March 2010 at 17:52.

Similar Threads

  1. 18F4550 Bootloader enter via eeprom setting
    By bradb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd November 2008, 23:51
  2. Replies: 6
    Last Post: - 5th November 2008, 11:30
  3. 18F2550 MCRL/RE3 problem with USB bootloader Microchip
    By Ronald123 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 24th September 2007, 10:48
  4. Some test hex for a 18f2550
    By f_lez in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th October 2006, 14:24
  5. Bootloader + Mainline code in single HEX file
    By dman776 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th May 2006, 22:59

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