If upgrading from MPLAB 7 set your debug tool for use with MPLAB X

Use the “MPLAB Device Driver Switcher”, right clicking and selecting “Run As Administrator” in Windows 7.

Create MPLAB X Project

Run MPLAB X IDE

Menu > File > New Project

Categories: Microchip Embedded

Projects: Standalone Project

Select the device

Select the debugging tool

Select the Compiler to use

Set project name and “Set as main project”

Add Source Code Files

Add your initial project files to the projects “ProjectName.X” directory.

Right click the project > Add Existing Item > Select the files

Drag them into the Header Files and Source File folders.

XC8 Projects

See here: http://electronics-design.net/embedded-programming/microchip-pic/pic18/xc8-compiler/projects-xc8-compiler/new-xc8-project

Setting Up Debug / Release Mode

Old MPLAB allowed you to use this macro in code:

__DEBUG

to detect if a debug or release mode was selected. It was just built in, but its not in MPLAB X.

So add this to a global header file when debugging:


#ifndef __DEBUG
#define __DEBUG						//<<<<< COMMENT OUT FOR RELEASE
#endif

Compiler Settings

IMPORTANT – ENSURE YOU CHECK THE BASIC COMPILER SETUP OPTIONS TO HELP ENSURE YOU DON’T GET CAUGHT UP IN STUPID BUGS

USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.