MPLAB® XC16 C Compiler

Microchip’s latest compiler line, the MPLAB® XC, provides a comprehensive solution for your project’s development software needs and replaces all MPLAB C and HI-TECH compilers. The MPLAB XC16 compiler:

  • Supports all 16-bit PIC® MCUs and dsPIC® DSCs
  • Integrates with MPLAB® X IDE to provide a full graphical front end:
    • Editing errors and breakpoints match the corresponding lines in source code
    • Single step through C source code to inspect variables and structures at critical points
    • Data structures with defined data types, including floating point, display in watch windows
  • Runs on Windows, Linux and Mac OS X
  • Offers different optimization levels to suit your needs with FREE downloads available
xc.png
Click image to enlarge.

 Learn More

Files

 Self-Paced Training

The material in these training modules exists elsewhere on this site in a general reference format. However, the training modules present it in an organized, step-by-step sequence to help you learn the topic from the ground up.

 Frequently Asked Questions

Topic
XC16 Compiler Warnings: "Optimization may eliminate reads and/or writes to register variables"
Why does the program counter not reach the start of main()?
Unstable Digital Output Pins Behavior
Unable to Branch to the Bootloader Reset When the Boot Loader Reset is Located in the Auxiliary Flash on a PIC24
Software/Programming - MCU16 - Address Error Trap with EDAC Instruction and Incorrect Result by MAC Instruction
Pointer Comparison Fails
How do you synchronize the primary and secondary time bases on a dsPIC33EP PWM Module?
How do you find the size of functions using MPLAB® XC16 C Compiler?
Ensuring Compiler HPA is Recognized
16-bit Motor Control PWM - Overriding Complementary Pairs
The XC16 Compiler Populates the Interrupt Vector Table (IVT)
MPLAB® XC8, XC16, XC32 Compiler License Questions
How do you check if your MPLAB® XC compiler license is activated?
Compilers - MPLAB® XC16 sprintf No Longer Works with Long Double
Compiler - In MPLAB® XC16 v1.26 or higher, why do I get build errors in the .gld file?
Code Examples and Application Notes for PIC16
MPLAB® XC16/XC32 Compiler- How do you determine what files are inside a library (.a) file?
Why can’t I build in PRO Mode, even though the client machine is configured to use the Network Server license?
Where can I find the Peripheral Library for MPLAB® XC8/16/32?
C compilers - Casting to an expression is not working
How can I find my MPLAB® XC Compiler Activation key?
How do I place variables in EDS space using MPLAB® XC16?
How can I move an MPLAB® XC compiler license from one microchipDIRECT account to another?
Why is the compiler removing some of my code?
How can I cancel or renew my MPLAB® XC Compiler subscription license?
Why is the compiler not listed for my target device under MPLAB® X IDE?
Compilers - Can a subscription license be used as a network license?
In the MPLAB® X IDE output window, what does the message "HPA has ended" mean?
Can I remove the license from my machine to install on a newer machine?
How can I renew my HPA?
Why do I get the message "Options have been disabled due to restricted license" even though I have a valid license key?
Why am I encountering errors in my code pointing to missing Peripheral Library routines?
Where can I find older versions of the compiler?
Will HPA make my support for non-compiler related queries faster?
How do I change the output.hex file name in MPLAB® X IDE?
(XC16) Where can I find the interrupt vector names available for the device?
(XC16) How can I utilize the upper 8-bits of program memory to effectively store constants?
(XC16) What does the “PSV section '.const' exceeds 32K bytes” error mean?
(XC16) How do I instruct the compiler to divert the output of printf to UART2?
(XC16) Is it possible to have one common Interrupt Service Routine (ISR) for all interrupt vectors on the device?
Why Does It Take So Long To Build My Project?
What could cause glitches on an output port?
What could cause pins in a port to change from values I assign to them?
What could cause corrupted variables or code failure when I am using interrupts?
How do I fix errors relating to 'illegal conversion between pointer types' or 'illegal conversion of integer to pointer'?
Why don't the line numbers in an error message match the problematic line of code?
How do I ensure declarations are consistent across files?
How do I access bits in a RAM variable?
How can I speed up my interrupt service routine?
How do I create an array of pointers in program space (ROM)?
Why are some of my variables shown as not used?
Why are SFRs undefined in my assembly code?
When should I cast an expression?
Where can I find information about compiler messages?
Are administrator rights required to use the compiler in MPLAB® X IDE?
What is HPA (High Priority Access)?
© 2024 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.