Você está na página 1de 10

MyersTek

Electronic projects made easy


• Home

• Templates

• Tutorials

• Contact Us

Install MPLAB on Ubuntu 16.04


Published on: 2018/03/17 (Y/M/D)
Operating System: Ubuntu 16.04 LTS

Introduction
Let's get started! If you're reading this then it means that you want to write some code for a PIC
Microcontroller but need a little help with installation on Ubuntu. Well my friend you're in the right
place! This is a step by step tutorial that will guide you through the installation process.

Tutorial Index
• Step 1: Downloading the files
• Step 2: Extract MPLAB X IDE
• Step 3: Install Dependencies
• Step 4: Install MPLAB X IDE
• Step 5: Install XC Compiler
• Summery (Quick-n-Dirty)

Quick Tip: Pressing Alt+Left Arrow Keys will take you back one "clicked link" on most web sites.
Step 1: Downloading the files
Download MPLAB X IDE
Link to Microchips MPLAB X IDE
Navigate towards the bottom until you see tabs that say Features, Downloads, Documentation, and
Webinars. Select the Downloads tab and go down to the section that says " Linux 32-Bit and Linux 64-
Bit (Required 32-Bit Compatibility Libraries) ". Locate the newest version of MPLAB, then go to the
right and click the zip file icon to start the download. When the Downloads dialog appears make sure
the Save File radial is selected then click OK to start the download.

Download XC Compiler
Link to Microchips XC Complier
Navigate towards the bottom until you see tabs that say Additional Information, Downloads,
Documentation, and Compiler FAQs. Select the Downloads tab and go down to the section that says "
Linux 32-Bit and Linux 64-Bit (Required 32-Bit Compatibility Libraries) ". Locate the newest version
of the XC8 Complier, then go to the right and click the zip file icon to start the download. When the
Downloads dialog appears make sure the Save File radial is selected then click OK to start the
download.

Quick Tip: Pressing the Home Key will take you to the top of most web sites.

Step 2: Extract MPLAB X IDE


Now that we have the files downloaded it's time to do something with them. Open a terminal with
Ubuntu's Hot Key combination:

CTRL + ALT + t

A terminal has opened. Now what? Let's start by changing into the Downloads folder with the
command cd (change directory) followed by the directories name that we want to change into. Linux is
case sensitive so it is critical to type in the command exactly as you see it. Type this into the terminal
followed by pressing Enter:
cd Downloads/

You should see something like this " name@computer:~/Downloads$ " this is good, you're now in the
downloads folder.

Let's extract the MPLAB tar file you downloaded by running the tar command. To make things easier I
will teach you a little trick by pressing the tab key. Instead of typing in a long file name, you only need
to type in the first few letters of the file name such as MP or MPLA followed by pressing the tab key
and the rest will auto-magically fill in for you. Type this into the terminal followed by pressing Enter:

tar -xvf MP(Press tab Key)

During the extraction process you should have seen MPLABX-v4.15-linux-installer.sh or something
close to this before you were returned to the command prompt. Depending on the version you
downloaded the wording may be a little different but the same steps will apply.

Time to see the contents of the directory. To do this we will use the ls (list) command. Type this into the
terminal followed by pressing Enter:

ls
You should now see the following files listed MPLABX-v4.15-linux-installer.sh MPLABX-v4.15-
linux-installer.tar xc8-v1.45-full-install-linux-installer.run. If you see these files or something close to it
you are on the right track for a successful install.

Quick Tip: Pressing the Home Key will take you to the top of most web sites.

Step 3: Install Dependencies


Time to update your Ubuntu's repositories (library's of software). Type this into the terminal followed
by pressing Enter:

sudo apt-get update

You will be prompted for your password, Type in the password you login in with. When you're done
press Enter.

Upon completion you will be returned to the command prompt.

Now let's install the missing 32bit library's that are required for MPLAB and the XC Compiler to run.
Copy-n-Paste this into the terminal followed by pressing Enter:
sudo apt-get install libc6-i386 lib32gcc-5-dev libexpat1:i386 libx11-6:i386 libxext6:i386

You will be prompted with: Do you want to continue? [Y/n] press y followed by pressing Enter.

After this process has completed and you are returned to the command prompt your system will be
ready to install MPLAB X IDE.

Quick Tip: Pressing the Home Key will take you to the top of most web sites.

Step 4: Install MPLAB X IDE


Now that the required dependencies are installed we can now run the installer for Microchip's MPLAB.
To run an executable file the file name is proceeded with a ./. Let's now try that with the file we
extracted earlier. Type this into the terminal followed by pressing Enter:

sudo ./MPL(Press tab Key)

On a successful launch you will see a Splash Screen like the one shown below.
Success!! At this point you are at the setup window. Let's proceed by clicking Next >

If you want to use Microchips MPLAB IDE you only have one choice and that is to select I accept the
agreement followed by clicking Next >.

The next screen is the default installation directory. We will keep this to the default setting of
/opt/microchip/mplabx/v4.15 click Next > to proceed.

Time to select the programs that you would like to install. By default all check boxes are selected in the
event that they are not make sure that MPLAB X IDE and MPLAB IPE is selected. The last checkbox
is optional and that is Help Improve MPLAB X Products. Personally I dislike anything that spies on
you even with your consent so this box is always left unchecked on my machines. After the box's are
set click Next >.

After a little clicking it's time to finally install the programs/software. Click Next >.

Depending on the speed of your machine the installation process can take some time, be patient and
wait for this process to complete.
Reboot Advisory. During the installation of the IPE (Integrated Programming Environment) USB
drivers were installed to support Microchip's line of chip programmers. Click OK to continue.

Last screen for MPLAB's installer. Deselect All Check Boxes and click Finish

You will be returned to the terminal when the installation of MPLAB is complete.

Quick Tip: Pressing the Home Key will take you to the top of most web sites.

Step 5: Install XC Complier


Almost done! Just a few more steps then you're ready to start programming. When xc8-v1.45-full-
install-linux-installer.run was downloaded it was not executable so that must be changed in order to run
it. Let's run a simple command to make it executable. Type this into the terminal followed by pressing
Enter:

sudo chmod +x xc8(Press tab Key)

Ok the file is now executable, Time to run it! Type this into the terminal followed by pressing Enter:

sudo ./xc8(Press tab Key)


On a successful launch you will see a Splash Screen like the one shown below.

Success!! At this point you are at the setup window. Let's proceed by clicking Next >

If you want to use Microchips Compiler you only have one choice and that is to select I accept the
agreement followed by clicking Next >.

Not much to do at the License Type screen. Click Next >.

The next screen is the default installation directory. We will keep this to the default setting of
/opt/microchip/xc8/v1.45 click Next > to proceed.

You're now at the Compiler Settings screen. Select Apply settings to all users of this machine and Add
xc8 to the PATH environment variable. followed by clicking Next >.

After a little clicking it's time to finally install the XC8 Compiler. Click Next >.
Depending on the speed of your machine the installation process can take some time, be patient and
wait for this process to complete.

Almost done, you have arrived at the licensing screen now what? Well.... for the majority of us we will
click Next > and run it as the free version. For the people that do have a valid license key now is the
time to put it in followed by clicking Next >.

Last screen for Microchips XC8 installer. Click Finish

Success! After the installation you are returned to the command prompt.

Very good, Microchips MPLAB and XC8 is installed and ready to run. Let's close the terminal now.
Type this into the terminal followed by pressing Enter:

exit

You're done and ready to start your programming project.


Quick Tip: Pressing the Home Key will take you to the top of most web sites.

Summery (Quick-n-Dirty)
01) Download MPLAB X IDE
02) Download XC Compiler
03) Open Terminal: CTRL+ALT+t
04) Change Directory: cd Downloads/
05) Extract MPLAB: tar -xvf MPL(press tab key)
06) Update repositories: sudo apt-get update
07) Install required programs\library's: sudo apt-get install libc6-i386 lib32gcc-5-dev libexpat1:i386
libx11-6:i386 libxext6:i386
08) Run MPLAB Installer: sudo ./MPL(press tab key)
09) Follow MPLAB Prompts.
10) Make XC8 executable: sudo chmod +x xc8(press tab key)
11) Run XC8 Installer: sudo ./xc8(press tab key)
12) Follow XC8 Prompts. Select Add xc8 to PATH environment variable and Apply settings to all users
of this machine
13) Exit Terminal: exit
14) Installation Complete

Acknowledgements | Terms And Conditions Of Use | Subscribe |Unsubscribe

Você também pode gostar