--- ---

MPLAB Installation

28 Mar 2020 - Courtney McBeth

Windows Installation

MPLAB IDE

Download the Windows version of the MPLAB X IDE from the Microchip website. Run the installer. When prompted for the install location, choose a path that includes no spaces (e.g. C:\Microchip\mplabx\v5.30, not C:\Program Files (x86)\Microchip\mplabx\v5.30). Wait for the install to finish and then create a new folder called Projects within the Microchip directory. Clone the GitHub CUSail repository there and checkout the appropriate branch (rewrite_2K19 for now) using: git checkout branch_name. You can now open the NavAlgo project inside of MPLAB by clicking File->Open Project and navigating to the NavAlgo.X file within the GitHub repository you just cloned. Next, install the XC32 compiler to allow you to build the project.

XC32 Compiler

The IDE does not come with the compiler preinstalled, so you’ll need to download the MPLAB XC32/32++ Compiler installer from the Microchip website. Run the installer, making sure that the installation directory is in the same Microchip folder as the IDE (e.g. C:\Microchip\xc32\v2.40). All of the other installation settings can be left as the default options. Now you’ll need to specify the location of the compiler in the IDE. In the MPLAB IDE go to Tools->Options->Embedded->Build Tools->Add and add the path to the compiler (e.g. C:\Microchip\xc32\v2.40\bin). Once this is done, you’ll be able to start building the project, but it will fail because the peripheral library is missing.

Legacy Peripheral Libraries

The legacy peripheral libraries contain the functions that we use to communicate with sensors and actuators. Download the Windows PIC32 Legacy Peripheral Libraries installer (it’s not labelled as Windows, but it’s the one that isn’t Linux) from the Microchip website. Run the installer, making sure that the installation location is correct. It should be installed in the same location as the XC32 compiler. Make sure the version of the XC32 compiler is correct in the path name as well. By default it will be v1.40, so change it to the version you installed (v2.XX). Finish the installation and you should be able to successfully build the project!

Mac Installation

MPLAB IDE

Download the Mac version of the MPLAB X IDE from the Microchip website. The latest version (v5.40) is compatible with macOS Catalina. Run the installer. Clone the GitHub CUSail repository somewhere on your computer and checkout the appropriate branch (rewrite_2K19 for now) using: git checkout branch_name. You can now open the NavAlgo project inside of MPLAB by clicking File->Open Project and navigating to the NavAlgo.X file within the GitHub epository you just cloned. Next, install the XC32 compiler to allow you to build the project.

XC32 Compiler

The IDE does not come with the compiler preinstalled, so you’ll need to download the MPLAB XC32/32++ installer from the Microchip website. Run the installer. Check that the compiler toolchain is installed correctly by going to Project Properties in the sidebar menu on the bottom left of the IDE (inside of the Dashboard). The location of the compiler should be specified under Compiler Toolchain. Once this is done, you’ll be able to start building the project, but it will fail because the peripheral library is missing.

Legacy Peripheral Libraries

The legacy peripheral libraries contain the functions that we use to communicate with sensors and actuators. Download the peripheral libraries zip file from the Microchip website. Follow the instructions given on the download page to install the library. When you attempt to move the three new folders into the XC32 compiler folder, you will be asked if you want to replace the existing directories or merge them. You must choose merge or else other standard libraries that we need will be overwritten. Now you should be able to successfully build the project!