Programming HID Bootloader on PIC32

From Mech
Revision as of 13:14, 21 August 2009 by Andrew Long (talk | contribs)
Jump to navigationJump to search

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.

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 E3, 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. 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.
MPLAB DeviceConfigure.bmp


  • Choose Project>Project Wizard. Click Next
MPLAB ProjectWizardStart.bmp


  • Select the device from the drop down menu. Click Next
MPLAB ProjectWizardDevice.bmp


  • Select the Microchip PIC32 C-Compiler Toolsuite from the drop down menu. Click Next
MPLAB ProjectWizardToolsuite.bmp


  • Create a new project in the folder where you want the project and c files to be stored. Click Next
MPLAB ProjectWizardNewProject.bmp


  • Add the c files (if you already have some) in the folder to your project. Click Next
MPLAB ProjectWizardAddFiles.bmp


  • Click Finish
MPLAB ProjectWizardFinish.bmp


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
MPLAB IncludeSearchPath.bmp