AN1078 - How do you migrate an MPLAB® 8 demo project to MPLAB® X IDE and MPLAB® XC16?

As an example, the project which comes with the App Note "Sensorless Field Oriented Control of a PMSM" (AN1078) is an MPLAB® 8 project and fails to build with MPLAB X and MPLAB XC16.

Solution:

1

Unzip the project in a path with a short name (e.g., C://AN1078).

2

Open the project in MPLAB X IDE by going to File > Import > MPLAB IDE v8 Project.

3

Go to the XC Compilers web page and download the Legacy Peripheral Libraries for PIC24/dsPIC® DSCs. When installing, select the path where the latest version of the MPLAB XC16 compiler is installed.

4

Modify the following options for the XC16 Compiler:

  • Go to Project Properties > XC16 (Global Options) and check the 'Use Legacy libc' option.
  • Go to xc16-ld > Option Categories > Symbols and macros and delete the option.
  • Go to xc16-ld > Option Categories > Libraries and enter the library q. Some warnings will appear related to deprecated definitions, but the project should build.
© 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.