Difference between revisions of "Getting Started with PIC32"
NickMarchuk (talk | contribs) |
NickMarchuk (talk | contribs) |
||
Line 65: | Line 65: | ||
[[Image:nu32_complete.jpg]] |
[[Image:nu32_complete.jpg]] |
||
Note to program the |
Note to program the bootloader onto the board, the programming cable can only be plugged into the last five header pins one way: |
||
[[Image:nu32_program.jpg]] |
[[Image:nu32_program.jpg]] |
||
Revision as of 14:52, 17 December 2009
This page details getting started with the PIC32 board.
Please complete the software section prior to lab 1.
In lab 1, you will assemble a NU32 board, install a bootloader and create a Hello World Program.
Software
This section discusses the software that must be installed on your computer. This software is only compatible with Windows. We are going to install MPLAB (software used for editing, compiling, and debugging code), the C32 compiler (software to create the program) and the Microchip Applications Library (common source files for programming).
1. Download and Install MPLAB IDE vX.XX Full Release Zipped Installation located near the bottom of this page. You do not need to install HI-TEC C Installer when prompted.
2. Download and Install MPLAB C Compiler for PIC32 vX.XX Academic Version located near the bottom of this page (the academic version is free)
3. Download and Install the Microchip Applications Library here. This zip file is the library version released on 11-18-2009. More recent versions can be downloaded here but the files may not work with the code listed on the wiki. When installing this library, Microchip may prompt you to install .Net software. Click yes if this happens.
Assemble Board
The NU32 development board you are going to assemble already has a PIC32 microcontroller soldered on the board. You will be soldering the rest of the components.
Collect the following components from the PIC32 supply bin.
Parts list: A. B. C. D. E. F. G. H. I. J. K. L. M. N. O. P.
The PIC32 is already soldered to the board.
Begin soldering components, ending with the header pins.
Several components need to be soldered with the proper orientation. The #C capacitor needs to be soldered with the positive leave towards the PIC.
The resistor array needs to have the side with the dot facing the long end of the board.
The indicator LEDs need to have their positive leads toward the end of the board.
The power LED needs to have its positive lead facing the close edge of the board.
The 3.3V regulator needs to have its back side facing the power jack.
The finished board looks like this:
Note to program the bootloader onto the board, the programming cable can only be plugged into the last five header pins one way:
Bootloader
A bootloader is a program that enables you to easily install programs on the PIC32 using only a USB cable. Normally, an external programmer is needed for programming the PIC. The bootloader takes hex files created by the MPLAB compiler and programs them on the PIC. Hex files are binary representations of the c code. See the wikipedia page for Hex files here for more information.
Follow these directions to install a bootloader on your PIC.
First Program
We are first going to test that you installed the bootloader correctly.
- Download this HelloWorld zip file and extract the hex file . (This code flashes all of the LEDs at a 1 second period, if you hold down the USER button the period changes)
- Use these directions to load a Hex File with the bootloader.
Next, we are going to make a different Hello World program from scratch.
- Follow the directions here to code and program Hello World on to the PIC32 using the bootloader.