MPLAB® XC Compilers
If you are writing in C language, you will need to obtain and install a compiler. While these compilers work closely with MPLAB® X, they are not installed with the IDE. The compiler must be downloaded and installed separately.
Microchip offers three free C compilers. Compiler selection is based upon the device used.
- MPLAB XC8 supports all 8-bit PIC® and AVR® MCUs.
- MPLAB XC16 supports all 16-bit PIC MCUs and dsPIC® DSCs.
- MPLAB XC32/32++ supports all 32-bit PIC and SAM MCUs and MPUs.
What does the compiler do?
The compiler converts your C code into the assembly code for your target MCU.

Compiler Modes and Licenses
Microchip compilers operate in either Standard or PRO mode. The main differences between the two operating modes are the levels of optimization allowed and the price.
Standard mode is free to use and is enabled by selecting the FREE license option when installing the compiler. This is the most commonly used license and will also be used in this tutorial's demonstration. Standard mode provides three levels of optimization:
- Level 0 is minimum optimization which results in the fastest compile time.
- Level 1 is some optimization without sacrificing debug capability.
- Level 2 is a combination of optimizations that give the best balance of speed and code size.
PRO mode includes two additional options which provide optimizations for the fastest program execution and smallest code size. The PRO mode requires the user to purchase and activate either the Workstation or Network license.