Intro to MPLAB® XC Compilers

A compiler is a computer software that transforms computer code written in one programming language (source language) into another programming language (target language). The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a lower level language. - Wikipedia

If you are a developer writing your application code in C, you'll need to download the MPLAB® XC Compiler that takes care of converting your C code to assembly language (the language the microcontroller understands).

CompilerWork2.png

The MPLAB XC Compiler then launches the assembler which takes that assembly code, converts it to machine code, and outputs it into an Intel HEX file.

Intel HEX consists of lines of ASCII text that are separated by a line feed and/or carriage return. Each text line contains hexadecimal characters that encode multiple binary numbers. The binary numbers may represent data, memory addresses, or other values, depending on their position in the line and the type and length of the line. - Wikipedia.

HEXFile.png

That HEX file is programmed into the target microcontroller and contains the binary code (1s and 0s) that the MCU needs to work.

Microchip offers three different MPLAB XC compilers. The MPLAB XC8 C compiler which is used for all 8-bit devices including the PIC10, PIC12, PIC16, and PIC18 MCUs. The MPLAB XC16 for all 16-bit devices including PIC24 MCUs, dsPIC30, and dsPIC33. The MPLAB XC32 for all 32-bit devices including the PIC32MX and PIC32MZ families.

Each compiler is available for Windows®, MacOS® X, and Linux® hosts.

OS.png

The compilers can be run in two different modes, free or pro. These modes set the level of optimization when compiling a project and they determine how much memory your code will require and how fast your code will execute. The pro mode can be unlocked with the purchase of a license.

Licenses.png
© 2018 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.