MPLAB® X IDE Tutorial for Beginner

Table of Contents

MPLAB X IDE

MPLAB X IDE is Microchip’s free desktop IDE for PIC, AVR, SAM and dsPIC development. It runs on supported Windows, Linux and macOS systems and integrates device packs, compilers and programmer/debugger tools. Microchip’s current product page recommends MPLAB for VS Code for new and existing projects, so verify the preferred workflow before starting a new codebase. Microchip MPLAB X IDE.

MPLAB X IDE Features

Powerful Editor

  • Colorful syntax highlighting;
  • Support intelligent code completion;
  • Automatic code formatting based on user-defined rules;
  • Support intelligent refactoring of code;
  • Instant analysis function;

Friendly Interaction

  • Call graph window;
  • Plug-in function extension;
  • Customizable interface:
    toolbars, toolbar buttons, windows and window positions, etc.

Navigation Function

  • Task navigator with user-defined bookmarks:
    //TODO & //FIXME;
  • Project-based workspace:
    Multiple projects, tools and configurations, parallel debugging sessions;
  • Powerful navigation tools:
    Go to file, go to type, go to symbol, go to header file, go to declaration, use “Ctrl+mouseover” to go to hyperlink.

File History and Issue Tracking

  • Local file history feature;
  • A NetBeans plug-in for version control systems is also available;
  • Built-in support for Bugzilla issue tracker;
  • Integrate with editor for easy issue navigation;

MPLAB X IDE Tutorial

MPLAB X IDE provides a single integrated “environment” for developing code for embedded microcontrollers. The following is a simple tutorial on using MPLAB X IDE to develop microcontroller programs.

Tools Required

  • A supported 64-bit Windows, Linux or macOS computer
  • MPLAB X IDE and the compiler required by the exact target device
  • A programmer/debugger that the target device and current IDE release support
  • The target board, its schematic and a correctly wired debug/programming header

Step 1: MPLAB X IDE Installation

First, download the MPLAB X IDE installation package from the MICROCHIP official website:
https://www.microchip.com/en-us/tools-resources/develop/mplab-x-ide#tabs

Download the MPLAB X IDE
Download the MPLAB X IDE

After install the MPLAB X IDE software, you can open and see the overview: 

Overview of MPLAB X IDE
Overview of MPLAB X IDE

Step 2: MPLAB Compiler Installation

Combined with the MPLAB XC compiler, you can speed up your project development process. Download the compiler suitable for your project from the following link:
https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers

Download MPLAB® XC Compiler
Download MPLAB® XC Compiler

Select the compiler by device family: XC8 supports 8-bit PIC and AVR MCUs; XC16 supports 16-bit PIC MCUs; XC-DSC supports dsPIC DSCs; XC32 supports 32-bit PIC and SAM MCUs/MPUs. Confirm the device in the current compiler and device-pack documentation instead of choosing only by word size. MPLAB XC Compilers.

Installation process of MPLAB compiler:

MPLAB® XC Compiler
MPLAB® XC Compiler
MPLAB XC32 Compiler Setup Wizard
MPLAB XC32 Compiler Setup Wizard
Installation Directory of MPLAB XC32 Compiler
Installation Directory of MPLAB XC32 Compiler
MPLAB XC32 Compiler Settings
MPLAB XC32 Compiler Settings
Installing MPLAB XC32 Compiler
Installing MPLAB XC32 Compiler
Completing the MPLAB XC32 Compiler Setup Wizard
Completing the MPLAB XC32 Compiler Setup Wizard

Step 3: Add a Compiler to MPLAB X IDE

Open the MPLAB X IDE software, as shown in the figure below, prompting “No Compilers Found”. After installing the MPLAB XC compiler, we need to add it to the MPLAB X IDE software before it can be used.

No Compiler Found on MPLAB X IDE
No Compiler Found on MPLAB X IDE

Click “Tools” -> “Options” as shown in the figure below:

Click Tools Options on MPLAB X IDE
Click Tools Options on MPLAB X IDE

Then click the “Build Tools” option under “Embedded”. Click the “Add” button under “Toolchain:”:

Click Embedded_Build Tools and Add Compiler
Click Embedded_Build Tools and Add Compiler

Select the bin file from the installation path of the MPLAB compiler. Next, click “OK”.

Add New Toolchain from the MPLAB XC32 Compiler Directory
Add New Toolchain from the MPLAB XC32 Compiler Directory

After the bin file is successfully added to “Toolchain:”, click “Apply” and “OK”.

Apply to Add the MPLAB XC32 Compiler
Apply to Add the MPLAB XC32 Compiler

Step 4: MPLAB X IDE Programming

After installing the MPLAB X IDE software and MPLAB compiler, we start editing the program and downloading and debugging the program.

Create A New Project

In MPLAB X IDE, click File > New Project to pop up the New Project window. Select Microchip Embedded in “Categories:”, then select Standalone Project in “Projects:”.

Choose Microchip Categories and Standalone Project
Choose Microchip Categories and Standalone Project

Next, select the MCU model suitable for your current project in Device, such as: PIC32CX2051MTC128.
(Note that because I just installed the XC32 compiler, we need to select the PIC32 series MCU here.)

Select Device PIC32 Series
Select Device PIC32 Series

Then, select the XC32 compiler.

Select XC32 Compiler
Select XC32 Compiler

Write a Project Name, select the storage location of the project, and click “Finish”.

Select Project Name and Location in MPLAB X IDE
Select Project Name and Location in MPLAB X IDE

Write A Program

As shown in the figure below, after creating a new project, we can see the project list file on the left.

Project Menu on MPLAB X IDE
Project Menu on MPLAB X IDE

Right-click “Source Files” > “New” > “main.c” and add the main.c file to the created project. Then you can write a program for your microcontroller in this file.

Add a New main.c File under Source Files
Add a New main.c File under Source Files
Setting main.c File Name and Location
Setting main.c File Name and Location

The following is a simple PIC microcontroller program, which will light up an LED on the PIC microcontroller. You can modify and expand it as needed:

Add PIC Program Code to main.c File
Add PIC Program Code to main.c File

Code Compile and Download

After writing the code, you can click the button on the toolbar to compile and program.

Build for Debugging Main Project and Program Device
Build for Debugging Main Project and Program Device

Choose MPLAB X IDE, compiler, device pack, and probe versions together

At this review on 2 September 2026, Microchip lists MPLAB X IDE 6.35 and recommends MPLAB for VS Code for new and existing projects. This tutorial still applies to MPLAB X projects, but menu names and supported probes can differ by IDE, compiler and device-pack release.

DecisionVerifyEvidence to retain
Target deviceExact ordering code and installed device packPack version and device selection
CompilerXC8, XC16, XC-DSC or XC32 as requiredCompiler version and build log
Program/debugProbe support, target voltage, interface and reset methodConnection screenshot and programming log
ProductionConfiguration bits, memory map and output formatHEX/ELF, map file and programming notes

Sources: Microchip MPLAB X IDE; Microchip MPLAB XC Compilers.

MPLAB X IDE release checklist

  • Record the IDE, compiler and device-pack versions before importing or upgrading a project.
  • Verify target power, ground, debug-header pinout and programmer voltage before first connection.
  • Review configuration bits, linker memory regions, warnings and generated HEX/ELF files.
  • Archive the reproducible project, build log, programming settings and a known-good output file.

About Author

Picture of Aidan Taylor
Aidan Taylor

I am Aidan Taylor and I have over 10 years of experience in the field of PCB Reverse Engineering, PCB design and IC Unlock.

Share

Recommended Post

Need Help?

Scroll to Top

Instant Quote