The projects in this training series will require the following software and hardware tools installed on a computer.
Four main steps need to be completed:
Install MPLAB® X IDE.
Install MPLAB XC8 Compiler.
Install Hardware Programmer and Development Board.
Install MPLAB Code Configurator (MCC).
Each step is described below.
1. Install MPLAB X
The first step is to download and install the MPLAB X IDE. Follow the steps below to complete the installation for your operating system.
64-bit Windows is required for reasonable performance using MPLAB® X IDE. MPLAB X IDE can run on a 32-bit Windows installation, but will likely experience slower performance. It is recommended to update the operating system to 64-bit Windows prior to installing MPLAB X IDE.
Go to the location where you downloaded the installer. Unzip the downloaded file and run the installer: MPLABX-vX.XX-windows-installer.exe.
Depending on your Windows® security settings, you may get a window asking if you are sure you want to run this program. Click Yes.
2
Setup
Click Next >.
Click image to enlarge.
3
License Agreement
Click the I accept the agreement radio button.
Click Next >.
Click image to enlarge.
4
Installation Options
By default, MPLAB® X IDE will be installed at C:\Program Files (x86)\Microchip\MPLABX or C:\Program Files\Microchip\MPLABX as of v5.45. If you would prefer a different directory, click on the folder icon to the right of the text box and select the desired installation location.
If you don't have an internet connection, select No Proxy. Otherwise, select Use System Proxy Settings.
Click Next >.
Click image to enlarge.
5
Select Applications
If you only want to install MPLAB X IDE or MPLAB IPE, check or uncheck the appropriate boxes. Generally, you should install both programs.
Select the device families you want to be installed. Selecting only what you want makes the installation smaller. You can always run the installer again to add other device families or use the MPLAB Pack Manager to install a single device family pack.
Click Next >.
Click image to enlarge.
6
Ready to Install
Click Next >.
Click image to enlarge.
7
Installing
Wait until the installer has finished installing all components of the IDE.
Click image to enlarge.
8
Permit Device Driver Installation
The USB device drivers are required to communicate with Microchip's hardware development tools.
Check the Always trust software from Microchip Technology box to prevent this dialog from appearing in the future.
Click image to enlarge.
9
Complete
Leave the box checked if you want to have your web browser opened to the Microchip MPLAB XC compiler download page to download a compiler for use with MPLAB X IDE.
Uncheck the box if you already have a compiler or want to download one later.
Click Finish.
Installation is complete. There will be icons for MPLAB X IDE and MPLAB IPE on the desktop. There will also be launchers in the Windows/Start menu under All Programs > Microchip > MPLAB X IDE.
Click image to enlarge.
If you have already installed MPLAB X IDE, but are unable to communicate with our USB connected hardware tools, see step 9 of the installation instructions below for a possible solution.
If you are running a 64-bit distribution without multiarch support, you may need to install dependencies before you can run the installer.
1
Untar and Run Installer
Navigate to the directory where you downloaded the file and extract the shell script from the .tar file by running the following command:
tar -xvf MPLABX-vX.XX-linux-installer.tar
You may need to make the file executable. If so, run the command:
chmod u+x MPLABX-vX.XX-linux-installer.sh
Then as root or using sudo, run the installer:
sudo ./MPLABX-vX.XX-linux-installer.sh
If you have problems running the graphical installer, you can run the installer in text mode instead by specifying "text" as the mode parameter value (where 2.XX is the installer version): sudo ./MPLABX-vX.XX-linux-installer.sh --mode text
2
Setup
Click Next >.
If you don't have Java or the open source IcedTea installed, the installer will run in text mode in the terminal. You don't need to install Java for MPLAB X IDE to run. A special version of Java will be installed in the mplabx directory exclusively for use by MPLAB X IDE. It will not interfere with existing Java or IcedTea installations.
Click image to enlarge.
3
License Agreement
Click the radio button next to "I accept the agreement".
Click Next >.
Click image to enlarge.
4
Installation Directory
By default, MPLAB X will be installed at /opt/microchip/mplabx. If you would prefer a different directory, click on the folder icon to the right of the text box and select the desired installation location.
Click Next >.
Click image to enlarge.
5
Ready to Install
Click Next >.
Click image to enlarge.
6
Installing
Wait until the installer has finished installing all components of the IDE.
Click image to enlarge.
7
Reboot Advisory
Click OK.
Click image to enlarge.
8
Complete
Click Finish.
Installation is complete.
The package was installed into: /opt/microchip/mplabx
The executables reside in: /opt/microchip/mplabx/mplab_ide/bin
Click image to enlarge.
9
For Linux distributions that use systemd, the systemd-udevd unit may be setup to avoid inter-process communications via sockets for security reasons. Recently Ubuntu 18.04LTS has been shipped in this way. This is a change from 17.10. Other distributions like Manjaro are also shipped with blocked inter-process communications via systemd. MPLAB X IPE and IDE rely on the systemd-udevd unit for plug and play. MPLAB X software has udev rules that allow a program to run on plug-and-play notifications. This program relies on sockets to communicate with MPLAB X IDE and IPE. So, to have working plug-and-play in MPLAB X software, you need to re-enable socket communications.
You can do this by adding an override file for systemd-udevd.
$ sudo systemctl edit systemd-udevd
This will open an editor and will create an override.conf file. In the override file, include the following lines:
Go to the location where you downloaded the installer. Unzip the downloaded file and run the installer: MPLABX-vX.XX-osx-installer.dmg.
Depending on your Windows security settings, you may get a window asking if you are sure you want to run this program. Answer Yes.
2
Setup
Click Next >.
Click image to enlarge.
3
License Agreement
Click the radio button next to "I accept the agreement".
Click Next >.
Click image to enlarge.
4
Installation Directory
By default, MPLAB® X IDE will be installed at /Applications/microchip/mplabx/. If you would prefer a different directory, click on the folder icon to the right of the text box and select the desired installation location.
If you don't have an internet connection, select No Proxy. Otherwise, select Use System Proxy Settings.
Click Next >.
Click image to enlarge.
5
Select Programs
If you only want to install MPLAB X IDE (Integrated Development Environment) or MPLAB IPE (Integrated Programming Environment), check/uncheck the appropriate boxes. Generally, you should install both programs.
Select the device families you want installed. Selecting only what you want makes the install smaller. You can always run the installer again to add other device families or use the MPLAB Pack Manager to install a single device family pack.
Click Next >.
Click image to enlarge.
6
Ready to Install
Click Next >.
Click image to enlarge.
7
Installing
Wait until the installer has finished installing all components of the IDE.
Click image to enlarge.
8
Complete
Leave the box checked if you want to have your web browser opened to the Microchip MPLAB XC compiler download page to download a compiler for use with MPLAB X IDE.
Uncheck the box if you already have a compiler or want to download one later.
Click Finish.
Installation is complete. There will be icons for MPLAB X IDE and MPLAB IPE in the Applications>microchip>mplabx>v5.xx folder
Click image to enlarge.
2. Install MPLAB XC8 Compiler
The second step is to install the XC8 compiler. Follow the steps below to complete the installation at the default location. Once installed, MPLAB X should automatically find it when creating a new project.
Go to the location where you downloaded the installer. Unzip the downloaded file and run the installer: xc8-vX.XX-windows-installer.exe.
Depending on your Windows security settings, you may get a window asking if you are sure you want to run this program. Answer Yes.
2
Setup
Click Next >
Click image to enlarge.
3
Accept License Agreement
Click on the radio button next to I accept the agreement.
Click Next >
Click image to enlarge.
4
Choose Installer
If you are installing the compiler for use on your machine only, click on the radio button next to Install compiler.
If you have a network license and are installing on a server, click on the radio button next to Install the Network License Server.
Click Next >
Click image to enlarge.
5
Installation Type
If you selected a network license server, provide the name of the network license server.
Click Next >
Click image to enlarge.
6
Installation Directory
Use the default installation location or choose a different one, if you prefer.
Click Next >
Click image to enlarge.
7
Compiler Settings
Apply settings to all users of this machine
Leave checked or uncheck if required in your environment.
Add xc8 to the PATH environment variable
Not generally required unless you plan to use XC8 from the command line (terminal or script).
Click Next >
Click image to enlarge.
8
Ready to Install Compiler
Click Next >
Click image to enlarge.
9
Setup
Wait while the installer unpacks and installs all the files.
Click image to enlarge.
10
Licensing Information
Click Next > if you:
Have activated a license on a previous version of MPLAB XC8.
Wish to use the free version of the compiler (some optimization features disabled).
Otherwise, choose to:
Purchase a license (to receive an activation key that will unlock the Standard or Pro optimization features).
Use the Pro evaluation version (reverts to free version after 60 days).
Provide an activation key.
Click Next >
Click image to enlarge.
11
Installation Complete
Click Finish
Click image to enlarge.
1
Run Installer
You may need to make the file executable. In a terminal, go to the directory where you downloaded the installer and run the command:
chmod u+x xc8-vX.XX-linux-installer.run
Then as root or using sudo, run the installer:
sudo ./xc8-vX.XX-linux-installer.run
2
Setup
Click Next >
Click image to enlarge.
3
Accept License Agreement
Click on the radio button next to I accept the agreement.
Click Next >
Click image to enlarge.
4
Choose License Type
If you are installing the compiler for use on your machine only, click on the radio button next to Install Compiler.
If you have a network license and are installing on a server, click on the radio button next to Install the Network License Server.
Click Next >
Click image to enlarge.
5
Network Installation
If you are not using a network license server, leave this unchecked. Otherwise, check the box and provide the name of the network license server.
Click Next >
Click image to enlarge.
6
Installation Directory
Use the default installation location, or choose a different one if you prefer.
Click Next >
Click image to enlarge.
7
Compiler Settings
Apply settings to all users of this machine
Leave checked or uncheck if required in your environment.
Add xc8 to the PATH environment variable
Not generally required unless you plan to use XC8 from the command line (terminal or script).
Click Next >
Click image to enlarge.
8
Ready to Install Compiler
Click Next >
Click image to enlarge.
9
Setup
Wait while the installer unpacks and installs all the files.
Click image to enlarge.
10
Licensing Information
If you:
Have activated a license on a previous version of MPLAB xc8.
Wish to use the free version of the compiler (some optimization features disabled).
simply click Next >
Otherwise, choose to:
Purchase a license (to receive an activation key that will unlock the Standard or Pro optimization features).
Use the Pro evaluation version (reverts to free version after 60 days).
Provide an activation key.
Click Next >
Click image to enlarge.
11
Installation Complete
Click Finish
Click image to enlarge.
1
Run Installer
Go to the location where you downloaded the installer. Double click on the downloaded file to unpack it and run the installer: xc8-vX.XX-osx.app.
You may get a warning message window. You can click on Open to continue.
Click image to enlarge.
Your computer's login and password need to be entered if you have enabled that protection for new installations. If you don't have a password enabled you can just click on OK to continue.
Click image to enlarge.
2
Setup
Click Next >
Click image to enlarge.
3
Accept License Agreement
Click on the radio button next to I accept the agreement.
Click Next >
Click image to enlarge.
4
Choose License Type
If you are installing the compiler for use on your machine only, click on the Free radio button. Select Workstation if you have a workstation setup.
If you have a network license and are installing on a server, click on the radio button next to Network Client.
Click Next >
Click image to enlarge.
5
Network License
If you are not using a network license server, provide the name of the network license server.
Click Next >
Click image to enlarge.
6
Installation Directory
Use the default installation location, or choose a different one if you prefer.
Click Next >
Click image to enlarge.
7
Compiler Settings
Apply settings to all users of this machine
Leave checked or uncheck if required in your environment.
Add xc8 to the PATH environment variable
Not generally required unless you plan to use XC8 from the command line (terminal or script).
Click Next >
Click image to enlarge.
8
Ready to Install Compiler
Click Next >
Click image to enlarge.
9
Setup
Wait while the installer unpacks and installs all the files.
Click image to enlarge.
10
Licensing Information
Click Next > if you:
Have activated a license on a previous version of MPLAB XC8.
Wish to use the free version of the compiler (some optimization features disabled).
Otherwise, choose to:
Purchase a license (to receive an activation key that will unlock the Standard or Pro optimization features).
Use the Pro evaluation version (reverts to free version after 60 days).
Provide an activation key.
Then, click Next >
Click image to enlarge.
11
Installation Complete
Click Finish
Click image to enlarge.
3. Install Hardware Programmer and Development Board
The software drivers for the development tool are built into the MPLAB X software installation. The only steps required are to connect the programmer to the computer USB port and then to the development board.
ICSP™ Implementation Configuration
Connecting a PIC® MCU to a programmer/debugger uses a connection scheme called In-Circuit Serial Programming (ICSP). It's through the PGC and PGD connections that the device is programmed with the application software. These connections can be built on an electrical breadboard or circuit board per the schematic shown.
Figure: ICSP Application Circuit
For simplicity, Microchip offers many different development boards that already provide this type of built-in connection. For the projects in this series, the PICDEM™ Lab II Development Board is used with the components included with the board. The PICDEM Lab II has an ICSP 6-pin connector for the PICkit™ 3.
The PICDEM™ Lab II Development Board is a development and teaching platform for use with 8-bit PIC® microcontrollers (MCUs). At its center, a large prototyping breadboard enables users to easily experiment with different values and configurations of analog components for system optimization. Several external connectors allow for user-customizable expansion, while our library of labs and application notes enrich the development experience. The PICDEM Lab II Development Board is also fully compatible with our latest software development environment.
The PICkit™ 3 programmer is first connected to a USB port on your computer and then to the development board. To do so, follow along with the steps below:
1
Connect the PICkit 3 USB cable to the PICkit 3 programmer.
Click image to enlarge.
2
Connect the USB cable to a USB port on your computer.
Click image to enlarge.
3
Install the PIC® Microcontroller in your development board.
Click image to enlarge.
4
Connect the PICkit 3 to the programming port on your development board.
Click image to enlarge.
5
Connect power to your development board.
The PICkit 3 can power a development board with 50 milliamps or less. However, we recommend you power the board separately until you are familiar with the tool and the limitations of providing power through the ICD 3.
The ICD 3 is first connected to a USB port on your computer and then to the development board. To do so, follow the steps below:
1
Connect the USB cable to the ICD 3.
Click image to enlarge.
2
Connect the USB cable to a USB port on your computer.
Click image to enlarge.
3
Install the PIC® Microcontroller in your development board.
Click image to enlarge.
4
Connect the RJ11 cable to the ICD 3.
Click image to enlarge.
5
Connect the ICD 3 RJ11 cable to the programming port on your development board.
Click image to enlarge.
6
Connect power to your development board.
The ICD 3 can power a development board but we recommend you power the board separately until you are familiar with the tool and the limitations of providing power through the ICD 3.
The MPLAB® REAL ICE™ In-Circuit Emulator is connected to a USB port on your computer and then to the development board. To do so, follow the steps below:
1
Connect the USB cable to the emulator.
Click image to enlarge.
2
Connect the USB cable to a USB port on your computer.
Click image to enlarge.
3
Install the PIC® microcontroller in your development board.
Click image to enlarge.
4
Connect the RJ11 cable to the ICE.
Click image to enlarge.
5
Connect the ICE RJ11 cable to the programming port on your development board.
Click image to enlarge.
6
Connect power to your development board.
The REAL ICE cannot power a development board. The board needs to be powered separately.
Click image to enlarge.
4. Install MCC
The MCC requires you to first start MPLAB X and then from the MPLAB X menu, you can install the MCC plugin. Follow the instructions given below.
1 MCC Installation
The MCC plugin can be installed from the Tools/Plugins menu in the MPLAB X IDE