User`s guide
What is MPLAB
®
IDE?
© 2006 Microchip Technology Inc. DS51519B-page 13
Step 1 is driven by the designer, although MPLAB IDE can help in modeling circuits and
code so that crucial design decisions can be made.
MPLAB IDE really helps with steps 2 through 4. Its Programmer’s Editor helps write
correct code with the language tools of choice. The editor is aware of the assembler
and compiler programming constructs and automatically “color-keys” the source code
to help ensure it is syntactically correct. The Project Manager enables you to organize
the various files used in your application: source files, processor description header
files and library files. When the code is built, you can control how rigorously code will
be optimized for size or speed by the compiler and where individual variables and pro-
gram data will be programmed into the device. You can also specify a “memory model”
in order to make the best use of the microcontroller’s memory for your application. If
the language tools run into errors when building the application, the offending line is
shown and can be “double clicked” to go to the corresponding source file for immediate
editing. After editing, press the “build” button to try again. Often this write-compile-fix
loop is done many times for complex code as the sub-sections are written and tested.
MPLAB IDE goes through this loop with maximum speed, allowing you to get on to the
next step.
Once the code builds with no errors, it needs to be tested. MPLAB IDE has components
called “debuggers” and free software simulators for all PICmicro MCU and dsPIC DSC
devices to help test the code. Even if the hardware is not yet finished, you can begin
testing the code with the simulator, a software program that simulates the execution of
the microcontroller. The simulator can accept a simulated input (stimulus), in order to
model how the firmware responds to external signals. The simulator can measure code
execution time, single step through code to watch variables and peripherals, and trace
the code to generate a detailed record of how the program ran.
Once the hardware is in a prototype stage, a hardware debugger, such as MPLAB ICE
or MPLAB ICD 2 can be used. These debuggers run the code in real time on your
actual application. The MPLAB ICE physically replaces the microcontroller in the target
using a high-speed probe to give you full control over the hardware in your design. The
MPLAB ICD 2 uses special circuitry built into many Microchip MCUs with Flash pro-
gram memory and can “see into” the target microcontrollers program and data memory.
The MPLAB ICD 2 can stop and start program execution, allowing you to test the code
with the microcontroller in place on the application.
After the application is running correctly, you can program a microcontroller with one of
Microchip’s device programmers, such as PICSTART
®
Plus or MPLAB PM3. These
programmers verify that the finished code will run as designed. MPLAB IDE supports
most PICmicro MCUs and every dsPIC Digital Signal Controller.