1.安装好MPLAB X IDE v5.00后,编译器的界面如下:

2.新建文件:File -> New Project

3.“Microchip嵌入式”->“独立项目”->“下一步”

4.这里选择16位的单片机,以PIC32MM032GPL028为例。选择好后点击“NEXT”.

5.选择下载工具,在ST单片机中相当于是JLNK,STLINK等下载工具,这里选择的是PICkit3,然后点击"NEXT".

6. 选择32位,XC32为编译器,在此之前,需要安装xc32编译器,然后在MPLAB X IED中添加该编译器,具体方法是在Tool->Options->Embedded中添加XC32安装根目录下的Bin文件,如下图所示的路径。

选择XC32安装目录下的路径:

回到正题上来:选择如下的编译器。

7.定义一个文件名,然后选择文件保存的路径,最后选择编码方式,选择GB2312是为了避免编程中出现中文字符乱码的现象。
做完这些,一个工程就建立完啦。

8.接下来我们就要对新建的空的工程中添加文件啦。

9.定义.c文件名