How to get a firmware .hex running on a PIC18F2550

bootloaderfirmwaremicrochipmicrocontrollerusb

I've been playing with this data logger board that's based on the Microchip PIC18F2550, but my application requires a lot of analog front-end signal conditioning. I would like to combine everything on one custom board, but I can't tell if it's possible to get the data logger firmware running on a virgin PIC18F2550. The data logger contains a bootloader that allows firmware updates via USB; the firmware .hex is available for download, but no bootloader code is available.

I haven't used microcontrollers before, so I have several questions that I haven't been able to answer from the data logger website or the PIC18F2550 datasheet:

  1. Is the bootloader something that is pre-loaded on the PIC18F2550 by Microchip, or must it be installed by the developer?

  2. If the bootloader is pre-loaded, then I presume all I need is a USB connection to the PIC (as on the original board) and the "Microchip USB HID Bootloader" utility to install firmware the first time. Correct?

  3. If the bootloader is not pre-loaded, then may I use a programmer via the ICSP header to install firmware, without a bootloader? If so, what hardware and software do I need, and what is the process to do this?

Thank you!

Here's the data logger schematic:

Data Logger Schematic

Best Answer

To answer your questions:

1) The bootloader would be loaded by the developer. 2) Skipped; It's not pre-loaded. 3) Yes, you can use a programmer to load a new program onto the PIC but if you don't include the boot loader then it will be overwritten unless you account for the bootloader or load it on yourself. The hex file you create should start writing to memory after the bootloader's location, and probably needs to be configured to work with the bootloader. The bootloader is provided by Microchip and there are app notes on how to use it. You can also find a compatible programmer on Microchip's website.

One of the reasons for the boot loader is so you don't have to use a programmer. It allows you to connect via USB and load the new hex file without using a programmer.

From the link:

To perform a firmware upgrade first, switch the SW1 to 'A' for bootloader mode and connect it to USB port. Then program the iCP12 with provided firmware (iCP12_xx_Firmware.hex) file using the Microchip USB HID Bootloader application. Disconnect the iCP12 and switch back the SW1 to 'B' for normal operation.

The exe for the HID bootloader application can be found in the iCP12_usbStickPack (software pack) found in the download section from the link you posted (http://www.piccircuit.com/shop/pic-dev-board/119-icp12-usbstick-pic18f2550-io-board.html).