Get the C32 “Standard
Edition.” After 90 days, the
advanced optimizations will
time-bomb, but the compiler will
still work fine. Get the 2.02a
installed and the PDF compiler
Users Guide and C Libraries manual.
The Peripheral Library manual is
more hidden; get it here:
C32 has a peripheral library that makes configuring and
using these ports easier to handle. This is great for us
hobbyists because the PIC32 uses the MIPS core which
includes interesting things like multiple device busses,
“look ahead” caches, out-of-order instruction handling,
and more stuff that can make the chip difficult to
understand and configure. I’ll show you how to use those
libraries and macros built into the C32 compiler to make
our lives easier.
Install and Use the
IDE and Compiler
The first step down the code path is creating a project.
You will need to install MPLAB and the C32 compiler first.
Here is where you will find them:
MPLAB 8.84 IDE — www.microchip.com/stellent
Get MPLAB IDE v8.84. This is a zip file. Install this first.
Microchip C32 compiler — www.microchip.com/
Step 1: Create a folder where you want your project to
live. Do this in Windows, not the IDE.
Step 2: Run MPLAB and use Project->New Project. Give
the project a name, and use the Browse button to navigate
to the project directory that you created in Step 1 (see
Step 3: Select your processor: Configure->Select
Device ... You will be using the PIC32MX795F512L for
the MAX32 board.
Step 4: Open the Project and
Output views from the View menu.
Step 5: Create or add your files.
If you already had files you wanted
to use, you can put them in the
folder you created for your project.
Right-click on the Source Files folder
in the Project view under your
<name>.mcp heading and select
add files. Alternatively, you can just
start creating a new file, save it to
your folder, and add it as above.
In Figure 5, I have an example
layout with the Hello World example
Now, we’re finally to the fun
16 SERVO 05.2012