You are on page 1of 169

2010 Microchip Technology Incorporated. All Rights Reserved.

1415 IDE Slide 1


1415 IDE
Introduction to MPLAB

X IDE
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 2 1415 IDE
MPLAB

X
Agenda
Introduction
Rationale
Key features
A Tour of MPLAB X
Lab 1: Create a new project
How to build applications
MPLAB 8 vs X
Project Properties Side-by-Side
How to work with the editor
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 3 1415 IDE
MPLAB

X
Agenda
How to work with the main toolbar
Lab 2 How to convert an MPLAB 8
project
How to work with a debugger
How to navigate a project
Search, Editor Features, Navigate Menu
Navigator Window
Favorites
Call Graph
How to work with the local history
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 4
Introduction
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 5 1415 IDE
Introduction
Why change everything?
MPLAB 6-8.x has run its course
IDE feature set showing its age
Difficult to add many requested features
Not easily extensible by 3
rd
parties
Lacking some infrastructure for advanced
high level language development
" A little revolution now and then is a
healthy thing, don't you think?"
Captain Marko Ramius
The Hunt for Red October
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 6 1415 IDE
Introduction
Rationale
A mature IDE proven through years of use
by thousands of developers worldwide
A modern IDE with all the latest features
Cross platform compatibility
A documented, extensible architecture
It's open source!
Many requested features are already there
Architected from the ground up with
support for advanced high level language
development
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 7 1415 IDE
Introduction
Rationale
A feature-rich IDE that isn't bloated
A large ecosystem of plug-ins
An IDE that can be used for embedded and
PC development
A project file structure that doesn't require
the IDE (great for external tools)
An IDE that keeps track of changes
A powerful project navigation system
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 8 1415 IDE
Introduction
Why didn't we use Eclipse like everyone else?
Because everyone else gets in the way of
a good, targeted product
NetBeans is acknowledged by many as
being:
More advanced
Less bloated
Faster
More intuitive (easier to use GUI)
We are NetBeans sole embedded partner
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 9 1415 IDE
Introduction
Why didn't we use Eclipse like everyone else?
For testimonials, check out:
http://netbeans.org/switch/realstories.html
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 10 1415 IDE
MPLAB

X
Key Features
Color coded syntax highlighting
Live parsing flags errors as you type
Smart code completion makes suggestions and
provides hints as you type
File history to view recent changes and revert,
even without a version control system
Powerful navigation tools: Go to file, Go to type,
Go to symbol, Go to header, Go to declaration
Refactoring tools to intelligently restructure
code
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 11 1415 IDE
MPLAB

X
Key Features
Automatic code formatting based on user
defined rules
Built-in Diff (can use external too)
Tasks navigator finds code marked with special
comments (user defined) e.g. //TODO, //FIXME
Fully customizable editor: toolbars, toolbar
buttons, windows, window placement
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 12 1415 IDE
MPLAB

X
Key Features
Built-in support for version
control systems:
Subversion, CVS, Mercurial
others via plug-ins
Built-in support for Bugzilla
issue tracker
Integrated with editor for ease
of navigating issues
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 13 1415 IDE
MPLAB

X
Projects and Workspaces
Workspaces are gone
Projects contain all relevant information
When you open MPLAB X, the last open
project is loaded
When you open a project, most windows /
tabs are restored to their previous layout
Multiple projects are handled with Project
Groups
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 14 1415 IDE
MPLAB

X
Debug vs Release
The dreaded Debug/Release combo box is
gone!
Different toolbar buttons used to build and
program for debug versus release
Build and Program (Debug) Build and Program (Release)
(Will say " Default" on release)
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 15 1415 IDE
MPLAB

X
Upgrading from MPLAB 8
A project conversion utility is built-in
MPLAB 8 projects cannot be opened directly
Project files/structure completely different
Manual conversion easy but time consuming
MPLAB X uses WinUSB/LibUSB drivers rather
than custom drivers in MPLAB 8
8 and X can be installed side by side
Hardware tool drivers must be switched
Switching utility available
Compilers / assemblers are unaffected
Exceptions MPASMAssembler
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 16
A Tour of MPLAB

X IDE
Parts of the IDE
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 17 1415 IDE
A Tour of MPLAB

X IDE
Parts of the IDE
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 18 1415 IDE
A Tour of MPLAB

X IDE
Parts of the IDE
Project Window
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 19 1415 IDE
A Tour of MPLAB

X IDE
Parts of the IDE
Navigator Window
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 20 1415 IDE
A Tour of MPLAB

X IDE
Parts of the IDE
Output Window
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 21 1415 IDE
A Tour of MPLAB

X IDE
Parts of the IDE
Editor Window
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 22 1415 IDE
A Tour of MPLAB

X IDE
Parts of the IDE
Main Toolbar
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 23 1415 IDE
A Tour of MPLAB

X IDE
Parts of the IDE
Editor Toolbar
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 24 1415 IDE
A Tour of MPLAB

X IDE
Parts of the IDE
Glyph Margin
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 25 1415 IDE
A Tour of MPLAB

X IDE
Parts of the IDE
Error Stripe
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 26
How to create a new project
Instructor led hands-on exercise
Lab 1
Lab 1
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 27 1415 IDE
Lab 1
Create a new project
Objective
Create new project with the project wizard
Create new C source file
Add existing files to project to control Explorer 16 LCD
Configure the C compiler tool chain
Build code and debug on the target board
Requirements: Explorer 16 Demo Board with PIC24FJ 128GA010
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 28 1415 IDE
Click on the New Project icon on the
toolbar, or select File New Project from
the menu
Lab 1
Create a new project
Launch the New Project Wizard
Unlike MPLAB 8, you must use the wizard in MPLAB X because it creates
both the project directory itself as well as an entire hierarchy of
subdirectories that it needs to work properly. Manually creating a project is
not possible.
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 29 1415 IDE
Lab 1
Create a new project
Choose Project
Select
Microchip
Embedded
under Categories
Select C/ASM
Standalone Project
under Projects
Click
Next >
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 30 1415 IDE
Lab 1
Create a new project
Select Device
Select
PIC24FJ128GA010
Click
Next >
The Family combo box
will filter the device list in
the Device combo box to
make specific devices
easier to find.
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 31 1415 IDE
Lab 1
Create a new project
Select Tool
Select Real ICE
Click
Next >
Select the serial number
that corresponds to the
MPLAB

REAL ICE in-


circuit emulator you wish
to use. If multiple REAL
ICE units are connected to
your PC, you will see
multiple serial numbers.
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 32 1415 IDE
Lab 1
Create a new project
Select Compiler
Select C30
Compiler Toolchain
Click
Next >
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 33 1415 IDE
Lab 1
Create a new project
Select Project Name and Folder
Name the project
and choose where
you want the project
directory to be
created
Click
Finish
This is the directory of where the
project directory will be created or
already exists. (i.e. this will be the
parent directory of the project
directory)
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 34 1415 IDE
MPLAB

X Automatically Generated Project Directory Structure


Lab 1
Create a new project
LocalDisk(C:) LocalDisk(C:)
RTC RTC
Lab1 Lab1
TLS0101X TLS0101X Project Location (User's choice)
Project Folder - Source Files (*.c, *.h)
build build
Embedded Embedded
debug debug
production production
dist dist
Embedded Embedded
debug debug
production production
nbproject nbproject
private private
Intermediate Files (*.o, *.o.d)
Output Files (*.elf, *.hex)
Project Settings / Configuration
C
r
e
a
t
e
d

b
y

M
P
L
A
B
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 35 1415 IDE
Create a new logical folder under Source Files
Lab 1
Create a new project
Right click on Source Files
and select New Logical
Folder from the pop-up menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 36 1415 IDE
Rename new logical folder
Lab 1
Create a new project
Expand Source Files to make its
contents visible. Right click on
New Folder 1 and select
Renamefrom the pop-up menu
Name the folder LCD and click OK
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 37 1415 IDE
Add existing files to logical folder
Lab 1
Create a new project
Right click on the LCD folder and
select Add Existing Itemfrom
the pop-up menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 38 1415 IDE
Select all lcd*.c files (use ctrl+click and/or shift+click)
Lab 1
Create a new project
Relative
Store path as:
Select all files of the
form lcd*.c
and
SwitchPressed.c
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 39 1415 IDE
Add existing header file
Lab 1
Create a new project
Right click on Header Files and
select Add Existing Itemfrom
the pop-up menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 40 1415 IDE
Select TLS2130.h
Lab 1
Create a new project
Relative
Store path as:
Select TLS2130.h
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 41 1415 IDE
Lab 1
Create a new project
Create a new C source file
Right click on the Source Files folder under the Projects tab
and select from the pop-up menu: New C Source File
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 42 1415 IDE
Lab 1
Create a new project
Specify name and location of new C source file
Name the file.
Leave the Folder
box blank to create
the source file in the
project directory.
Click
Finish
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 43 1415 IDE
Lab 1
Create a new project
Add code to new source file
#include <p24FJ128GA010.h>
#include "TLS2130.h"
_CONFIG1(FWDTEN_OFF & JTAGEN_OFF)
int main(void)
{
lcdInit();
lcdPutStr("Hello, world!");
TRISA = 0;
LATA = 0x55;
while(1);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
Add the following code to Lab1.c
You can copy it from C:\RTC\TLS0101X\source.txt
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 44 1415 IDE
Lab 1
Create a new project
Build project and run program on demo board
Click on the Debug Project toolbar button
This will:
a. Build your code for debugging
b. Program the target
c. Run the program
When done, click on Pause then End Debug Session
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 45 1415 IDE
Lab 1
Create a new project
D9, D7, D5 and D3 should turn on, " Hello, world!" on LCD
9-15V DC
+
10 k
+5
+3
GND RD6 S3 RD7 S6 RA7 S5 RD13 S4
D1
S1
D10 D9 D8 D7 D6 D5 D4 D3
Y2
MCLR
OPTREX
Graphics LCD
J1
F-51320GNB-LW-AB
<- PIC - PIM ->
PIC24 F4550
G
N
D
3
.
3
V
5
V
9
V
G
N
D
3
.
3
V
5
V
9
V
JTAG
J9
PICtail+
P
I
C
K
I
T
2
1 1
Explorer 16
Development Board
2
9 10
19 20
29 30
2
9 10
19 20
29 30
J6 J5
39 40
49 50
59 60
1
39 40
49 50
59 60
69 70
79 80
89 90
99 100
109 110
119 120
69 70
79 80
89 90
99 100
109 110
119 120
J12
P1
J8
JP1
Ostapiuk 2006
JP2
Y1
Y3
R
B
6
R
B
7
R6
D10 D9 D8 D7 D6 D5 D4 D3
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 46
How to build applications
Compiling or assembling code
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 47 1415 IDE
MPLAB

8 MPLAB X
How to Build Applications
Make
(Menu: Project Make)
Build only files that have
changed since the last build
Build All
(Menu: Project Build All)
Builds all files regardless of
whether or not they have
changed since the last build
Build Project
Build only files that have
changed since the last build
Clean and Build Project
Builds all files regardless of
whether or not they have
changed since the last build
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 48 1415 IDE
MPLAB

8 MPLAB X
How to Build Applications
Working with a Debugger
Debug Project
Debug Mode
Make
Program Target Device
Reset
Run
Debug Mode
Make
Program Target Device
Reset
Run
In most situations, it is not
necessary to hit the " Build"
or " Clean and Build" button
before hitting this button.
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 49 1415 IDE
MPLAB

8 MPLAB X
How to Build Applications
Working with a Programmer
Program Target Project
Release Mode
Make
Program Target Device
Make
Program Target Device
Release Mode
In most situations, it is not
necessary to hit the " Build"
or " Clean and Build" button
before hitting this button.
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 50 1415 IDE
MPLAB

8 MPLAB X
How to Build Applications
Working with a Debugger/Programmer
Run Project
Release Mode
Make
Program Target Device
Release from Reset (Run)
Make
Program Target Device
Release Mode
In most situations, it is not
necessary to hit the " Build"
or " Clean and Build" button
before hitting this button.
Release from Reset
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 51 1415 IDE
How to Build Applications
Gotchas platform related errors
Relative paths should use '/' instead of '\':
#include "Graphics/Graphics.h"
'/' works on ALL platforms, including Windows
'\' works ONLY on Windows
Compiler on Linux cannot find files with paths
using '\', which is an escape character in the
Linux Bourne Again Shell (BASH)
Linux is case sensitive
#include <p24fj128ga010.h> won't be
found because filename is p24FJ128GA010.h
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 52
How to work with the editor
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 53 1415 IDE
Editor
Live Parsing
IDE parses code as you type
Editor immediately marks errors
Tooltips and glyphs display compiler
hints,
warnings,
quick fixes
and
language
docs
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 54 1415 IDE
Editor
Smart Code Completion
Not working quite right yet
When typing in a function, a pop-up
should appear showing the parameter list
and data types
After typing in the first few letters of a
function or variable name, the editor may
provide suggestions for completing the
identifier
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 55 1415 IDE
Editor
How to use the Task List
Automatically scans code for words like
TODO and FIXME within comments
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 56 1415 IDE
Editor
How to add keywords to the task list parser
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 57 1415 IDE
Editor
How to view two files side-by-side
Click and drag a tab away from the top of the editor pane.
The red outline indicates where it will snap into place when
released.
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 58 1415 IDE
Editor
How to split the view of a single file
Right click on the file's tab and select
Clone Document from the pop-up menu
Click and drag
the duplicated
tab to its new
location
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 59 1415 IDE
Editor
How to maximize/restore editor window
MAX MIN
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 60 1415 IDE
Editor
How to list all open tabs and jump between them
Useful if you have more tabs open than
can be displayed across the top
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 61 1415 IDE
Editor
How to configure the editor's settings
Select Tools Options from the menu,
then select Editor from the icons on top
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 62
How to work with the main toolbar
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 63 1415 IDE
How to Work with the Main Toolbar
Default Buttons
New File
New Project
Open Project
Save All
Undo
Redo
Build
Rebuild (Clean and Build)
Run Project (Build, Program, Run)
Debug (Build, Program, Run)
Profile Project
Program Target
Project
Configuration
MPLAB

X
Memory Usage
Quick Search
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 64 1415 IDE
How to Work with the Main Toolbar
How to Customize the Toolbars
Right click on a toolbar
Select Customize
Drag items from list to
desired location on
toolbar
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 65
Lab 2
Lab 2
How to convert an existing project
Instructor led hands-on exercise
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 66 1415 IDE
Lab 2
Convert an Existing Project
Objective
Convert Graphics Object Layer Demo project from MAL
with the project wizard
Run program on Explorer 16 with Graphics Demo
Board (version 2 or 3)
Requirements: Explorer 16 Demo Board with PIC24FJ 128GA010
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 67 1415 IDE
Click on the New Project icon on the
toolbar, or select File New Project from
the menu
Lab 2
Convert an Existing Project
Launch the New Project Wizard
Unlike MPLAB

8, you must use the wizard in MPLAB X because it creates


both the project directory itself as well as an entire hierarchy of
subdirectories that it needs to work properly. Manually creating a project is
not possible.
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 68 1415 IDE
Lab 2
Convert an Existing Project
Choose Project
Existing MPLAB

IDE v8 Project Microchip Embedded


Next >
Click
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 69 1415 IDE
Lab 2
Convert an Existing Project
Import Legacy Project
Next >
Click
C:\Microchip Solutions\Graphics Object Layer Demo\GOLDemo PIC24.mcp
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 70 1415 IDE
Lab 2
Convert an Existing Project
Select Device
Next >
Click
PIC24FJ128GA010
(Should be selected automatically)
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 71 1415 IDE
Lab 2
Convert an Existing Project
Select Tool
Next >
Click
Select
Real ICE
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 72 1415 IDE
Lab 2
Convert an Existing Project
Select Compiler
Next >
Click
Select
C30
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 73 1415 IDE
Lab 2
Convert an Existing Project
Keep or Copy Files
Next >
Click
Click
Keep Files
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 74 1415 IDE
Lab 2
Convert an Existing Project
Select Project Name and Folder
Next >
Click
Accept
Defaults
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 75 1415 IDE
Lab 2
Convert an Existing Project
Summary
Finish
Click
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 76 1415 IDE
Lab 2
Convert an Existing Project
Build and test the project
When done, click on Pause then End Debug
Session
Click on the Clean and Build button on the toolbar
If the build is successful, then the project converted
properly. Just to be absolutely sure, try it out on the
hardware by clicking the Debug button on the
toolbar
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 77
How to work with a debugger
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 78 1415 IDE
MPLAB

8 MPLAB X
How to Build Applications
Working with a Debugger
Finish Debugger Session
Continue
Pause
Run to Cursor
Step Into
Step Over
Step Out
Reset
(No equivalent yet)
(No Equivalent)
Run
Halt
Run to Cursor (Context Menu)
Step Into
Step Over
Step Out
Reset
Animate
ICON CHANGED ICON CHANGED
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 79 1415 IDE
Breakpoints
How to set a line breakpoint
Click on the line number in the left margin (glyph
margin) until a red square ( ) appears (breakpoint
set). Click again to clear the breakpoint.
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 80 1415 IDE
Breakpoints
How to set a conditional line breakpoint
Select Debug New Breakpoint
Choose Line as the Breakpoint Type
Specify the data File and Line Number settings
(automatically populated
from cursor position)
Specify the Pass count
Condition
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 81 1415 IDE
Breakpoints
How to set a data breakpoint
Select Debug New Breakpoint
Choose Data as the Breakpoint Type
Specify the data Address and Breaks on settings
Specify the Pass count
Condition
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 82 1415 IDE
Breakpoints
How to view a list of all breakpoints in the project
Select Window Debugging Breakpoints
Right click in Breakpoints window to:
Create new breakpoint
Enable all breakpoints
Disable all breakpoints
Delete all breakpoints
Group breakpoints (allows enable/disable by group)
Change a breakpoint's settings
Double click to go to source
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 83 1415 IDE
Watches
How to display the watches tab
From the menu:
Window Debugging Watches
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 84 1415 IDE
Watches
How to add a variable to the watches tab
(Optional) Highlight
variable in editor
Right click in editor or
select from menu:
Debug New Watch
Type in variable name
or just accept the one
that is there and click
on OK
OK
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 85 1415 IDE
Watches
Watches: Structure and Union Support
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 86 1415 IDE
Watches
How to change a watch variable's radix
Right click on the value
From the pop-up menu select:
Display Value As radix
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 87 1415 IDE
Watches
How to change a watch variable's value
Double click on the existing value
Type in the new value, hit Enter when done
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 88 1415 IDE
Watches
How to remove a watch variable
Select watch variable and hit or right
click variable and select Delete from pop-
up menu
Delete
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 89 1415 IDE
Watches
How to sort watch variables
Default
(Fields Sorted Numerically)
1
st
Click:
Sort Ascending (Alphabetically)
2
nd
Click:
Sort Descending (Alphabetically)
3
rd
Click:
Default
Click on the column headings
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 90 1415 IDE
Memory Windows
How to view embedded memory
From the menu, select
Window Embedded Memory
Mdb Memory View n
You can have up to 4 windows that
are any combination of:
File Registers
SFRs
Program
Configuration
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 91 1415 IDE
Memory Windows
How to select the embedded memory type to display
Select the
memory
space to
display from
the Memory
combo box,
then select
the display
format from
the Format
combo box.
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 92 1415 IDE
Memory Windows
Display Options
Option Value Description
Format
Memory
Data
Code
RAM Physical
Flash Physical
Peripheral
CPU
Configuration Bits
Data memory (RAM)
Program Memory (ROM)
All RAM memory on device
All Flash memory on device
All SFRs
All CPU memory
All Configuration registers
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 93 1415 IDE
Memory Windows
How to change a memory location's value
Double click on
a cell and start
typing the new
value hit
Enter when
done
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 94 1415 IDE
Memory Windows
How to fill memory
Right click in
memory window and
select Fill Memory
from the pop-up
menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 95 1415 IDE
Memory Windows
How to quickly jump to a specific address
Right click in the memory window and
select Go Tofrom the pop-up menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 96 1415 IDE
Call Stack
How to view the call stack
Select Window Debugging Call Stack
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 97
How to navigate a project
Search, Editor Features, and the Navigate Menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 98 1415 IDE
Editor Toolbar
Last Edit Cycle through edits
Previous Edit
Next Edit
Find Selection
Find Previous Occurrence
Find Next Occurrence
Toggle Highlight Search
Previous Bookmark
Next Bookmark
Toggle Bookmark
Shift Line Left (Indent Less)
Shift Line Right (Indent More)
Start Macro Recording
Stop Macro Recording
Comment
Uncomment
Go to Header/Source
* Next and Previous Edit buttons become active after using Navigate Go to X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 99 1415 IDE
How to search within a file
With a source file open in the editor, select
Edit Find from the menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 100 1415 IDE
How to search in the project
Select Edit Find in Projectsfrom the
menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 101 1415 IDE
How to search documentation
Type some text in the Quick Search box
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 102 1415 IDE
How to find usages
Highlight a function or variable
Select Edit Find Usages from the menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 103 1415 IDE
Editor
Go To File
Sometimes
only finds
object files
(need to
investigate)
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 104 1415 IDE
Editor
Go To Type
Find type definitions and jump right to
them by double clicking in the dialog's list
enum, struct, union in C
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 105 1415 IDE
Editor
Go To Symbol
Find symbol definitions and jump right to
them by double clicking on the dialog's list
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 106 1415 IDE
Editor
Go to Declaration
Highlight variable or function name, right
click, select Navigate Go to Declaration...
from the pop-up menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 107 1415 IDE
Editor
Go to Header
Go to header with same base name as
current source file (if one exists)
e.g. MyFile.h from MyFile.c
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 108 1415 IDE
Editor
Navigation: Error Stripe
E
r
r
o
r

S
t
r
i
p
e
Errors
Warnings
Occurrences
Color Code
Represents full length of file
Shows relative position of errors,
warnings and occurrences of currently
highlighted item
Cursor
Position
Error
Scroll Bar Slider
Breakpoint
Bookmark
Suggestion
Multiple Items
Clickable
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 109 1415 IDE
Editor
Navigating to Errors and Warnings
Pop-up showing error corresponding
to icon pointed to by mouse pointer
(arrow)
Pop-up showing error
corresponding to bar
pointed to by mouse
pointer (hand)
Error Stripe
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 110 1415 IDE
Editor
Navigation: Glyph Margin
When multiple
glyphs are required
on a line, a small
black arrow
pointing down
appears to the right
of one glyph.
Clicking on the
arrow will cycle
through the glyphs.
Error and Bookmark on the same line
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 111 1415 IDE
Editor
How to set / clear a bookmark
Right click on the line number in the
margin and select from the pop-up menu:
Bookmark Toggle Bookmark
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 112 1415 IDE
Editor
Code Folding
Tools Options Editor General to enable or disable
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 113 1415 IDE
Editor
How to View a Register's Bit Values
Hover mouse over a register variable
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 114
How to navigate a project
How to work with the Navigator Window
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 115 1415 IDE
How to Work with the Navigator
Lists all identifiers in selected file
Double click on entry to jump to
identifier's definition
(or declaration if extern)
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 116 1415 IDE
How to Work with the Navigator
Filters
Right click in the Navigator
window and select Kind
Filters from the pop-up
menu to change which
items will be displayed in
the window
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 117 1415 IDE
How to Work with the Navigator
Find Usages
Right click on symbol
name in navigator and
select Find Usages from
the pop-up menu
Results appear in output
window under Usages tab
(double click them to jump
to source file where used)
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 118 1415 IDE
How to Work with the Navigator
How to refactor a symbol name
Right click on symbol
name in navigator and
select Renamefrom the
pop-up menu
Enter the new
name and click
or
Refactor
Preview
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 119 1415 IDE
How to Work with the Navigator
How to refactor a symbol name
allows you to see how the change
will be implemented before committing to
do the refactoring
Cycle through each instance in the preview windows on the right
Preview
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 120
How to navigate a project
Favorites
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 121 1415 IDE
Favorites
How to view the favorites list
Select Window Favorites from the menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 122 1415 IDE
Favorites
How to add a file to the favorites list
Right click in the open source file and select
Select in Favorites or Navigate Select in
Favorites from the main menu to open the Add
to Favorites dialog (if file is not already there)
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 123 1415 IDE
Favorites
How to add a file to the favorites list
Right click in the Favorites window and select
Add to Favoritesfrom the pop-up menu
Not limited to code can add any file (e.g. PDF
reference guide)
Double clicking the PDF will open up the file in your PDF
reader (e.g. Adobe Reader, Evince, etc.)
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 124 1415 IDE
Favorites
How to remove a file from the favorites list
Right click on an item in the favorites
window and select Remove from Favorites
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 125
How to navigate a project
How to work with the Call Graph
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 126 1415 IDE
How to Work with the Call Graph
Static Call Graph
Definition
Static Call Graph A flow chart showing the calling
relationships of subroutines in a program. It represents every
possible path a function can take.
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 127 1415 IDE
How to Work with the Call Graph
Generate Call Graph for a Function
Right click on a function and select Show Call
Graph from the pop-up menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 128 1415 IDE
How to Work with the Call Graph
Two Modes of Operation
Who is called
from the
function?
Who calls this
function?
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 129 1415 IDE
How to Work with the Call Graph
Navigation Go to Declaration
Double click on top node to Go to Declaration of function
Cursor
placed at
function
header
Alternately, right click on top
node and select Go to
Declaration from pop-up menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 130 1415 IDE
How to Work with the Call Graph
Navigation Go to Declaration
Double click on diagram block to Go to Declaration
Function
header is
highlighted
Alternately, right click on block
and select Go to Declaration
from pop-up menu
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 131 1415 IDE
How to Work with the Call Graph
Navigation Go to Reference
Double click on child node to Go to Reference of function
Cursor
placed where
function:
calls
or is
called by
top node's
function
Alternately, right click on
child node and select Go to
Reference from pop-up
menu, or double click on
arrow in graphical view
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 132 1415 IDE
How to Work with the Call Graph
View function calls with parameters
In the left pane, select a child node function
Select
Function
Lower pane shows how:
Top node function calls child node function
Top node function is called by child node function
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 133 1415 IDE
How to Work with the Call Graph
Change focus to child node function
Focus On
Select
Function
Alternatively, right click on function and select Focus On
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 134 1415 IDE
How to Work with the Call Graph
Expand Callers
Method 1:
In left pane, click on '+' next
to function name
Method 2:
In right pane, right click on
block and select Expand
Callers from pop-up menu
(Who calls the selected child function?)
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 135 1415 IDE
How to Work with the Call Graph
Expand Callees
Method 1:
In left pane, click on '+' next
to function name
Method 2:
In right pane, right click on
block and select Expand
Callees from pop-up menu
(Who is called by the selected child function?)
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 136 1415 IDE
How to Work with the Call Graph
Export the graph as a PNG file
Right click anywhere in the call graph window and
select Exportfrom the pop-up menu
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 137
How to work with the local history
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 138 1415 IDE
Local History
How to display the local history
Right click on file, select from pop-up menu:
Local History Show Local History
Shows list of changes and visual
diff of changes
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 139 1415 IDE
Local History
How to insert code from a previous version
Click on blue arrow in right margin
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 140 1415 IDE
Local History
How to undo changes
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 141 1415 IDE
Local History
How to revert to an earlier version of a file
2010 Microchip Technology Incorporated. All Rights Reserved. 1415 IDE Slide 142
Appendix 1
MPLAB

8 vs MPLAB X
Project Options Side by Side
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 143 1415 IDE
Project Options
From the menu:
ProjectBuild Options... Project
Right click on project icon:
Select Build Optionsfrom pop-up
menu
From the menu:
FileProject Properties (name)
Right click on project icon:
Select Properties from pop-up menu
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 144 1415 IDE
Project Options
Embedded Category: 3 in 1
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 145 1415 IDE
Project Options
How to select the target device
MPLAB

8 MPLAB X
From the menu:
ConfigureSelect Device
From the menu:
FileProject Properties (name)
Right click on project icon:
Select Properties from pop-up menu
Select Embedded category
N
o
t

i
n

P
r
o
j
e
c
t

>

B
u
i
l
d

O
p
t
i
o
n
s

2010 Microchip Technology Incorporated. All Rights Reserved. Slide 146 1415 IDE
Project Options
How to select the hardware tool
MPLAB

8 MPLAB X
From the menu:
Debugger Select Tool
Programmer Select Programmer
From the menu:
FileProject Properties (name)
Right click on project icon:
Select Properties from pop-up menu
Select Embedded category
N
o
t

i
n

P
r
o
j
e
c
t

>

B
u
i
l
d

O
p
t
i
o
n
s

2010 Microchip Technology Incorporated. All Rights Reserved. Slide 147 1415 IDE
Project Options
How to select the build tool
MPLAB

8 MPLAB X
From the menu:
Project Select Language
Toolsuite
From the menu:
FileProject Properties (name)
Right click on project icon:
Select Properties from pop-up menu
Select Embedded category
N
o
t

i
n

P
r
o
j
e
c
t

>

B
u
i
l
d

O
p
t
i
o
n
s

2010 Microchip Technology Incorporated. All Rights Reserved. Slide 148 1415 IDE
Project Options
How to select the build tool
Build tool locations available under Tools
Options, Embedded section
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 149 1415 IDE
Project Options
Include Paths
Select Directories tab
Select Include Search Path
Select Compiler
Select General category
Add paths to Include directories
Quote paths, use forward slashes, separate paths by
semicolons, no spaces around semicolons:
" . . / MyDi r " ; . ; " . . / MyOt her Di r "
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 150 1415 IDE
Example
Project Options
Paths
1. Quotes (" ) around paths containing spaces are
optional
2. Separate paths with a semi-colon (;)
3. Forward (Linux style) slashes (/) or back
(Windows style) slashes (\) are supported
"../Board Support Package";.;"../Microchip/Include"
For relative paths:
. (one dot) represents the project directory
.. (two dots) represents the parent directory
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 151 1415 IDE
Project Options
Assembler Include Search Path
Select Directories tab
Select Asm. Incl. Search Path
Select Assembler
Select Symbols & Macros
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 152 1415 IDE
Project Options
Library Paths
Select Directories tab
Select Library Search Path
Select Linker
Select Libraries category
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 153 1415 IDE
Project Options
Intermediary Directory
Select Directories tab
Select Intermediary Directory
Not implemented
MPLAB X specifies its own
intermediary directories within
the project directory
./build/Embedded/debug
./build/Embedded/production
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 154 1415 IDE
Project Options
Output Directory
Select Directories tab
Select Output Directory
Not implemented
MPLAB X specifies its own
output directory within
the project directory
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 155 1415 IDE
Project Options
Compiler Settings (General)
Select Compiler tab
Select General category
Select Compiler
Select General category
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 156 1415 IDE
Project Options
Compiler Settings (Memory Model)
Select Compiler tab
Select Memory Model category
Select Compiler
Select Memory Model category
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 157 1415 IDE
Project Options
Compiler Settings (Optimization)
Select Compiler tab
Select Optimization category
Select Compiler
Select Optimization category
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 158 1415 IDE
Project Options
Linker Settings (General)
Select Linker tab
Select General category
Select Linker
Select General category
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 159 1415 IDE
Linker Option Differences
" Negative" versus " Positive" Options
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 160 1415 IDE
Project Options
Linker Settings (Diagnostics)
Select Linker tab
Select Diagnostics category
Select Linker
Select Diagnostics category
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 161 1415 IDE
Project Options
Linker Settings (Symbols & Macros)
Select Linker tab
Select Symbols & Macros category
Select Linker
Select Symbols & Macros category
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 162 1415 IDE
Project Options
Linker Settings (Libraries)
Select Linker tab
Select Libraries category
Select Linker
Select Libraries category
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 163 1415 IDE
Project Options
ASM/C Suite Settings
Select ASM/C Suite tab Not implemented yet
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 164 1415 IDE
Project Options
Assembler Settings (General)
Select Assembler tab
Select General
Select Assembler
Select Other Options
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 165 1415 IDE
Project Options
Assembler Settings (Symbols & Macros)
Select Assembler tab
Select Symbols & Macros
Select Assembler
Select Symbols & Macros
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 166 1415 IDE
Project Options
Custom Build Settings
Select Custom Build tab Could be implemented via
custom makefile edit file in root of
project: "./makefile"
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
GUI may be added later to handle
makefile modification.
Makefile modification provides more
flexibility and granularity.
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' targe
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 167 1415 IDE
Project Options
Trace Settings
Select Trace tab TBD
MPLAB

8 MPLAB X
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 168 1415 IDE
Tools Options
Absolute / Relative Paths
Auto
Always Relative
Always Absolute
2010 Microchip Technology Incorporated. All Rights Reserved. Slide 169 1415 IDE
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC, KeeLoq, KeeLoq logo,
MPLAB, PIC, PICmicro, PICSTART, PIC
32
logo, rfPIC and UNI/O are registered
trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor, MXDEV, MXLAB, SEEVAL
and The Embedded Control Solutions Company are registered trademarks of
Microchip Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard, dsPICDEM,
dsPICDEM.net, dsPICworks, dsSPEAK, ECAN, ECONOMONITOR, FanSense, HI-TIDE,
In-Circuit Serial Programming, ICSP, Mindi, MiWi, MPASM, MPLAB Certified logo,
MPLIB, MPLINK, mTouch, Octopus, Omniscient Code Generation, PICC,
PICC-18, PICDEM, PICDEM.net, PICkit, PICtail, REAL ICE, rfLAB, Select Mode,
Total Endurance, TSHARC, UniWinDriver, WiperLock and ZENA are trademarks of
Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
All other trademarks mentioned herein are property of their respective companies.
2010, Microchip Technology Incorporated, All Rights Reserved.

You might also like