Difference between revisions of "Programming HID Bootloader on PIC32"
Andrew Long (talk | contribs) |
Andrew Long (talk | contribs) |
||
Line 4: | Line 4: | ||
== PIC software == |
== PIC software == |
||
You can download the PIC32 hex file and source files [[Media:HID_Bootloader_PIC32.zip | here]]. |
You can download the PIC32 hex file and source files [[Media:HID_Bootloader_PIC32.zip | here]]. I recommend placing these files in a new folder. This will become your project folder. |
||
== PC software == |
== PC software == |
Revision as of 13:30, 21 August 2009
The HID (Human Interface Device) bootloader is used to install programs on the PIC32 without using an external programmer like ICD2 and does not require any drivers on the computer. The HID bootloader for the PC is supplied with the Microchip Applications Library.
Software
PIC software
You can download the PIC32 hex file and source files here. I recommend placing these files in a new folder. This will become your project folder.
PC software
If you downloaded the Microchip Applications Library, the PC HID Bootloader program is located under the start menu Programs -> Microchip -> MCHPFSUSB v2.5 -> Tools -> HIDBootLoader You can also download the executable here. Running this requires a sufficiently recent version of the .NET Framework, which you may not have if you are running XP or earlier versions of Windows. You can download a sufficiently recent version here (the install takes a while): .NET Framework download.
Required circuitry
For the UBW32 and NU32 board, this circuitry is already on the board. This information is for people who are interested in making their own board.
A button must be wired to a pin that has been initialized as a digital input (similar to the RESET button). This PROGRAM button is used to put the PIC in Bootloading Mode. The UBW32 and NU32 board has the button wired to PIN E7 and PIN E5, respectively. The button can be put on any pin that supports digital input, but the bootloading program will have to be modified accordingly.
The PIC goes into Bootloading Mode when the PROGRAM button is held down when a RESET is called (ie hold down both PROGRAM and RESET and then release RESET). LEDS on the boards will flash to indicate that the PIC is in Bootloading Mode.
Installing a Bootloader on the PIC32
These directions detail how to install the HID Bootloader on the PIC32 with the Microchip MPLAB ICD 2 (In-Circuit Debugger). Before starting, Microchip MPLAB, Microchip C32 Compiler and the Microchip Applications Library must be installed.
Under Construction (ignore what's below)
Notes - Create New Project - Add files - Include Search Path - Add Device Name - Add Source Files USB
- Open MPLAB IDE.
- Choose Configure>Select Device to select the PIC you are working with. In the Device dialog, select the PIC you are using from the list if it’s not already selected. The lights show which software is supported for that PIC.
- Choose Project>Project Wizard to start a new project. Click Next
- Select the PIC from the drop down menu. Click Next
- Select the Microchip PIC32 C-Compiler Toolsuite from the drop down menu. Click Next
- Create a new project in the folder where you want the project and c files to be stored. I recommend creating a new folder that contains the source code for each project. Click Next
- Add the c files (if you already have some) in the folder to your project. Click Next
- Click Finish
The project has now been created. It will not compile because it does not know where the common header files of the Microchip Framework are located.
- Choose Project>Build Options>Project.
- In the directories tab, choose the Include Search Path.
- Add a New path - Browse to find the include folder (<Installation Folder> \pic32_solutions\Microchip\Include)
- Add a New path - type a period '.' (this will search the project folder)
- Click Apply and then OK