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.