GETTING STARTED WITHPICs
THE LATEST IN PROGRAMMING MICROCONTROLLERS
■ BY CHUCK HELLEBUYCK
GETTING STARTED WITH THE
PICBASIC™ PRO COMPILER AND
EMAIL FEEDBACK HAS MADE IT CLEAR THAT there are many who would
like me to go back and cover how to get started, as the title of the column
suggests. Though I’ve covered this in many previous columns, much has
changed, and there are still some beginner topics I have not covered.
One area missed is how to set up and use Microchip’s
MPLAB IDE for developing your programs. If you
write in assembly, C, or even microEngineering Labs’
PICBASIC or PICBASIC PRO compilers, you can use the
same MPLAB IDE. This is important to learn, especially for
those who may graduate from a hobbyist programmer to a
All Microchip tools work directly with the MPLAB IDE.
This includes the PICkit™ 2 Starter Kit (Part #DV164120),
which I’ve covered in many articles before and I plan to use
again as the hardware. For the software, I decided to keep
it simple and inexpensive by using the sample version of
the PICBASIC PRO compiler. This is the Basic language
compiler I’ve written about many times before. After all, the
BASIC acronym stands for “Beginner’s All-purpose Symbolic
Instruction Code.” The keyword, here, is beginner.
The sample version of the PICBASIC PRO compiler is
available as a free download from http://melabs.com/pbpde
mo.htm, and the MPLAB IDE is available as a free download
from www.microchip.com/mplab. The PICkit 2 Starter Package
will cost you $49.99 plus shipping if you purchase it from
www.microchipdirect.com, but you can get it for the same
price from Mouser or any other catalog source. The starter
package includes a PIC16F690 microcontroller (MCU), so the
free compiler and IDE downloads (plus the starter package)
will give you everything you need to start programming. If you
want to follow along with this article, you’ll need these items.
The MPLAB IDE is a very powerful tool, with a lot of
features. I will go over the essentials you’ll need to know
in order to get started quickly.
First, download the latest release of the MPLAB IDE.
96 May 2008
As I write this article, version 8.02 is the latest. The
MPLAB IDE download is a zip file that needs to be
extracted into the directory of your choice. Once you
have un-zipped the files, you will see a file named
“Install_MPLAB_v8.02.exe.” This is the installation setup
file that you need to run. Follow the installation procedure
and let it install at the default directory. This will put the
MPLAB IDE and all of its components in the C:\Program
Files\Microchip directory of your hard drive.
Next, download the PICBASIC PRO compiler demo
version into a directory on your hard drive. This includes
an installation file called “PBPDEMO3.EXE.” Run this file
and let it install at the default directory, which will be
located at C:\PBPDEMO.
Next, download the file called “ PBPlugins.bat.” This
file is strictly for the MPLAB-PBPRO connection. You can
get this program from the http://melabs.com/support/
mplab.htm page, along with details on how to use the
PICBASIC PRO compiler with the MPLAB IDE. I’m telling
you my way of doing this because I found one little glitch
that I could not get around, and I suspect you’ll run into
the same thing. Run the PBPlugins.bat program. The
instructions at microEngineering Labs’ mplab.htm Web
page explain how to update the search path for the
version of Microsoft Windows® you are running. Follow
those instructions and update the search paths.
Next is the trick I recommend for getting around the
glitch I ran into. Go to the C:\PBPDEMO directory and
you will see three folders — INC, MCS, and SAMPLES. Add
NOTE: The Microchip name and logo, MPLAB, and PIC are registered
trademarks of Microchip Technology, Inc., in the USA and other countries.
PICkit is a trademark of Microchip Technology, Inc., in the USA and
other countries. All other trademarks mentioned herein are property of
their respective companies.