XC8 Projects

Jump to our page here.

XC32 Projects

Jump to our page here.

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.

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.

Comments

Your email address will not be published. Required fields are marked *