Getting Started with PIC32
Follow these steps to get started with PIC32.
MPLAB is the software used for editing, compiling, debugging code. This software creates the HEX files to download to the PIC.
Download and Install Microchip MPLAB (Microchip's free IDE for editing, debugging and compiling code)
Download and Install Microchip C32 Compiler (the academic version is free)
Download and Install Microchip Applications Library located at bottom of page. This zip file contains common source code and header files. There is a separate stack for PIC32, but it has been rumored that the PIC32 stack is going to get merged with the applications library therefore the code on this website is based on the application library stack.
- Source and header files from the framework need to be added to the project if using USB communication
An advantage of the PIC32 is that a bootloader can be installed. This means you do not need a programmer to put new programs on the PIC. The UBW32 comes preloaded with a bootloader, but the NU32 board does not.
The HID bootloader is used to put HEX files on the PIC32. The HID bootloader should be included in the Applications Library downloaded above. It will be located under the start menu Programs -> Microchip -> MCHPFSUSB v2.5 -> Tools -> HIDBootLoader
NOTE: occassionally, the bootloader will get stuck verifying that the program is running. (There must be a bug in the bootloader application code) It will take 90-100% of CPU. End task manually with the task manager if this happens.
See Programming HID Bootloader on PIC32 for directions on how to install a bootloader on your PIC.
The directions here detail how to code and program Hello World on to the PIC32 using the HID Bootloader.
When creating new projects to download to the PIC, you must include a linker file. If you have installed a bootloader, the linker file tells the bootloader to put the program after the bootloader memory. The required linker file is called procdefs.ld. The standard linker file is here for PIC32. linker file is in the project folder. The procdefs.ld for UBW32 is different than the standard procdefs.ld for PIC32 when using the bootloader originally installed on UBW32. Make sure to use the procdefs.ld file here for UBW32.
This website warns that if the procdefs linker file is not in the project the bootloader may be hosed.