Working bootloader hex on 18f2550


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    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.

  2. #2
    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

  3. #3
    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.

  4. #4
    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.

  5. #5
    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.

  6. #6
    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.

  7. #7
    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

  8. #8
    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

  9. #9
    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.

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