Discuss this article in the SERVO Magazine forums at http://forum.servomagazine.com
Our resident expert on all things
robotic is merely an email away.
Tap into the sum of allhumanknowledge and get your questions answered here!
From software algorithms to material selection, Mr. Roboto strives to meet you
where you are — and what more would you expect from a complex service droid?
I got some takers wanting expanded information
based on previous columns, so I’ll answer one of them in
this issue, and add in (as a way of killing two avians with
one stone) a short review of the new Microchip MPLABX
IDE. As my loyal readers know, I am an Apple kind of guy,
so imagine my excitement when I found out a year or so
ago that Microchip was coming out with an OS-agnostic
IDE for their PIC line! (It made me shiver all right.) I’m kind
of fond of Microchip in general, and the higher-end PICs
specifically, so except for some robot programs that only
run on Windows (hint, hint), this was the last thing I
needed to stay in my favorite environment.
MPLABX runs on Netbeans which is a kind of Java
developer framework rather like Eclipse. There are releases
for MPLABX on Windows, Linux, and OS X, so there is
something here for everyone. There are installs for
hobbyists who use C compilers for all of the PIC line as
well, and they all run on all of the OS platforms. A shiny
new toy, so ONWARD!
However ... not a question exactly, but leading up to
an answer ...
Before I get into a reader’s query, I’m going to briefly
show how to set up a project with MPLABX. This will be a
bit of a quick start — rather than using a full blown manual
— because I firmly believe that any program that requires a
manual to use has already failed in its purpose! I’ll point
you a bit in the right direction, and you can poke around
on your own in the IDE’s corners and under its covers to
discover all that it will do.
The First Step: Install
14 SERVO 03.2012
To get the IDE and C compilers, go here: http://ww1.
On this page, you can select the Platform (upper left of
the page) and all of the compilers and documents that you
would like. I just clicked on all of the items and hit the
Download Now button. Remember, I’m an OS X user so my
description of this process will be distinctly Apple OS X
oriented. When you have gotten through all of the dialogs
questioning your sanity in downloading things from a
website, you (on a Mac) will have a DMG (disk image) for
the IDE, C18, C30, and C32 compilers, as well as a zip file
of release notes. If you so chose, you will also have two
PICC Hi-Tech “.run” files for the Hi-Tech compilers for the
PIC16 and PIC18 devices. The DMGs are obvious; mount
them and run the installer packages. Do the IDE first and
the compilers will automagically install in places that the IDE
will find them. I read on the MPLABX forums that to install
the Hi-Tech compilers, you will have to open a terminal
window (command line interface) and “cd” to your install
location (I used the defaults), and manually run these
installs as root:
chmod +x picc<blahblah>.run
Remember, OS X is basically UNIX under the hood;
these are UNIX commands to run shell scripts that need
root access. I’ve not done this yet, since I don’t know how
to use the Hi-Tech C compiler yet. After all of this, you have
everything installed. Now that you have the IDE installed,
plug in your ICD3, PicKit3, Real ICE, or whatever Starter kit
or supported programmer/ICD you have for your PIC. The
IDE will figure it out. I found that OS X didn’t have any
problem with my ICD3, so cool.
Creating a Project in MPLABX
I started out by clicking on the tab on the MPLABX
“Start Page” called “Import MPLAB Legacy Project.” I am
going to do this column using the Microchip Explorer 16
Developer Board with the PIC24FJ64GA004 PIM installed,
so I imported the Explorer 16 Demo program project by just
following what the Wizard told me to do. The project