[Menu]>[Guide to use the PIC]

How to use MPLAB Ver6.50

As for the MPLAB tool of the Microchip Inc., a frequently new version is released.
The operation methods differ in Ver5 and Ver6 of MPLAB.
I will introduce about the basic usage of MPLAB Ver6.50 here.
A function difference between Ver5 and Ver6 isn't explained.

The premise of explanation Starting MPLAB

I use the software for the synchronization pulse detection which was used with "Decorative light Controller" as an example.

A source file is the premise stored in test1 folder as shown in the above figure.

When starting MPLAB, a screen like the figure above is displayed.

Creation of a new project

A new project can be created if it clicks on a New Project icon.

Since the dialog of New Project is displayed, set a project name and a directory which stores a project.

The file list of the project is displayed. The required files are not made at this time yet.

A menu is displayed when choosing Source Files and clicking the right button of the mouse.
Click Add Files.

After choosing a source file, press "Open" button.

The source file was included in the project.

Setup of a project

Click Build Options icon and set the condition of the project.

Set Output Directory and Intermediates Directory in the General tab.
I did to the place which is the same as the source file.

Next, click MPASM Assembler tab and have Disable case sensitivity checking mark.
My source code is written by the lowercase but the INC file of the standard label definition is written by the uppercase. This setting makes a case sensitivity invalid.
When assembling my source file, this setting is indispensable.

Selecting of a device

Click Configure of the menu bar and select the device to use in Select Device.

This time, I selected PIC16F628.

Assembling operation

Double-click a source file from the project file list and open a source file.

Assembling will be started when clicking Make icon.

The elapse of the assembling is displayed by the bar graph.

When there is an error, the bar becomes red.

Output message is displayed when the assembling ends.
The figure on the left is in the condition that assembling was normally ended.
When there is an error, error contents are displayed.

When processing normally, HEX file is made and is stored in Output Directory.

It is displayed with the old-type source code in the first line of the message but there is no problem.

Displaying of a Listing file
The quantity consumed of the program memory is displayed in the Listing file.

Click Open File icon, choose * .lst by the file type and open the Listing file.

The state of memory is displayed on the last of the Listing file.
This time, it is displayed as follows.
Program Memory Words Used: 91
Program Memory Words Free: 1957

Setting of a debugger
The debugger is convenient for the operation confirmation of the assembled program.

The simulator of MPLAB can be used when choosing Debugger -> Select Tool -> MPLAB SIM by the menu bar.

An icon for the debugging is added to the icon bar.
RunExecute program code until a breakpoint is encountered or until Halt is selected.
HaltHalt (stop) the execution of program code.
AnimateContinually Step Into instructions.
Step IntoExecute the current instruction and then halt.
Step Over Execute the instruction at the current program counter location, then halt. If the instruction is a call instruction, execute the called subroutine and halt at the address following the call.
It is convenient when to check the processing step of the subroutine isn't necessary.
Step OutIn case of subroutine, step out of current location in a function and return to main program.
ResetReset as specified.