Long time ago I had a PICkit 2 programmer, which came with a nice little application that allowed for .hex files to be programmed without the need of MPLAB, and also worked as a logic analyzer. Then, I switched to PICkit 3 as the new range of Microchip microcontrollers was no longer supported by the PICkit 2. All went fine, but I missed the ability to program hex files, which is especially handy when burning bootloaders, or when I have to program existing compiled code.
Now, with the MPLABX we have again the possibility to program hex files directly, without the need of recompiling the code.
For this tutorial I will use an Explorer16 board, equipped with a PIC32MX360F512L PIM, on which I will program the ChipKit bootloader. I first downloaded the pic32-Arduino-Bootloader-master.zip file, then extracted its contents on my hard drive (drive F in this tutorial). The bootloader for Explorer 16 is in this case in the folder F:pic32-Arduino-Bootloader-masterdistmicrochip-pic32-explorer-16-360f512lproduction and is named arduino-booloader.X.production.hex.
Once we have located the file to be programmed, we open MPLABX. Then, we go to File –> New Project. In the new dialog window we make the following choices: Categories is set to “Microchip Embedded”, and Projects is set to “Prebuilt (Hex, Loadable Image) Project. Then, click on Next.
In the next dialog we first choose the name of the prebuilt file. I browse to the “F:pic32-Arduino-Bootloader-masterdistmicrochip-pic32-explorer-16-360f512lproduction” folder and I select the “arduino-booloader.X.production.hex” file.
Then, I select the microcontroller corresponding to the installed PIM. So, from the Families drop down list I select “32-bit MCUs (PIC32)”, and for the Device I choose “PIC32MX360F512L”. Next, I select the PICkit 3 programmer from the Hardware tool list by clicking on the serial number of the programmer. Then, click next.
The next window shows the project summary. I like too keep things in order and to place the project field in the same folder where the hex file is. I looks that MPLABX thinks the same, so I don’t change anything. Notice the warning related to the long path. I just ignored it and pressed Finish, but you may wish to change it to a shorter path if things go wrong.
After clicking on Finish, MPLABX moves us on the default view. In the top corner we have the projects windows, and by clicking on the “Prebuilt files” we should see the name of our bootloader hex file.The Output window should display “Loading code from F:pic32-Arduino-Bootloader-masterdistmicrochip-pic32-explorer-16-360f512lproductionarduino-booloader.X.production.hex… Loading completed”
I will use the PICkit 3 to provide the power to the Explorer16 board. Remember that PICkit 3 can provide power to the target circuit, with a voltage between 1.8 and 5V, but with a current limit of 30mA. I right-click on the project name (text in bold), and from the lowest line of the drop-down list I select “Properties.” In the new window, in the Categories I click on “PICkit 3”, and from the Option categories drop-down list I go to “Power”. I check the Power target circuit from PICkit 3 tick mark, leaving the voltage at 3.25V. I click on Apply then OK to close the Properties window.
The last step is to program the microcontroller by going in the top bar to Run –> Run main project.
If everything is OK the output window will show something like this:
Connecting to MPLAB PICkit 3…
Firmware Suite Version…..01.30.09
Device ID Revision = B4 B6
The following memory area(s) will be programmed:
boot config memory
The D5 LED on the explorer board will blink to indicate the bootloader is waiting.
… That is all …
[Update 27 March 2015] Well hidden in the MPLABX download page there’s a section named PICkit Archives. There you can find a download link for a PICkit3 standalone application. It works just as badly as the rest of the Microchip software, but still easier to use than the MPLAXB procedure described above.
 I found that the same bootloader hex file works great also with the PIC32MX460F512L PIM
 ChipKit bootloaders for Explorer 16 can be downloaded from https://github.com/chipKIT32/pic32-Arduino-Bootloader
 Download page for the standalone application is http://www.microchip.com/pagehandler/en-us/family/mplabx/