Monday, November 11, 2013

MPLAB X IDE Ubuntu Linux

Ref- Mplab X IDE Tutorial 

The only pain that I had with “Mplab” was that the interface was too old and unfortunately, Linux versions of Mplab were not available. So, to program my PIC18F4550 microcontroller I had to install a Virtual machine on my Linux (Ubuntu) and run windows on it. So, I had to be dependent on windows Virtual machine to use MPLAB IDE.

MPLAB X IDE and XC8 Compiler on Linux Ubuntu with advanced features
However the Mplab new version, that is Mplab X IDE solved that problem big time. Hurray it can be now installed on Linux machine too. Yes, the new versions still has some old bugs carried over with old Mplab IDE to its new makeover, but still at least it saved a lot of trouble by eliminating dependency on Windows computer totally. I am not a great fan of windows since I migrated to Linux 3 years ago.

Yes, the new MPLAB X IDE does look more like a cracked version of NetBeans but I guess I am OK with that. Now it looks better and has all the good features. I have been working on NetBeans long ago for my java projects so sometimes working on Mplab X IDE feels more like a tweaked version of NetBeans to me, but that absolutely fine.

Starting Mplab X IDE in Linux Ubuntu

In old versions, I had to install different compiler for programming a pic16f and a pic18f  but with new XC8 compiler took care of all those issues, as it doesn't require having different compiler suits. The XC8 C compiler alone handles most of them together.

Installing on Mplab X on Ubuntu was little tricky, But it all worked out favorably well. The java had to be updated before I could begin installing the Mplab X IDE on Linux I had to change the file permission. On Ubuntu before we can execute installation files it requires to make the file Executable by enabling “Allow Executing the Program as File” from properties and it started the installation like a charm without any trouble.

Linux Terminal and java update for Mplab X IDE and XC8 C

Mplab X IDE and XC8 C compiler on Linux Operating system

Mplab X IDE and XC8 C Installation

The User interface looks better, and I found some exiting things about Mplab X IDE. The execution happens faster and in the older version if you miss a semicolon then you had to wait till you compile the code and a window will tell you that you missed something,
But in the interactive version that problem also got solved, as it provides auto suggestions and point out right there if you are missing something or if you have made a typo in the source code, just like any other latest IDEs.

MPLAB X IDE starting after Installation - Loading Modules

Another thing which I noticed was the size of the .hex files after compiling. Soon after installation of Mplab X ide and XC8 Compiler, for the sake of testing I wrote a small code to blink led on pic18f4550, with first line of code as #include<p18f4550.h>. In XC8 compiler instead of include<p18f4550> you can also write Include<PIC18f4550> , I guess they have made some changes with libraries so it supports old and new libraries.

After compiling the Source code for the first time in new MPLAB X , I was little puzzled to see the output hex file appeared far short to me. For some time I actually though that there might be some issue with the IDE or I missed out something in the coding.

Mplab X IDE Tutorial  Programming and coding

So I checked my coding again and recompiled, but still there was no difference. To test out , I burned the new hex file into the microcontroller and I was shocked that it was working the way it was supposed to work. The led’s were blinking.

Conclusion was quiet clear that the output generated by Mplab X IDE was optimized and much shorter then what the old version of IDE did. I compiled the same code again with an old version of MPLAB and it generated a much more lengthy output then that of Mplab X.

You can find a short tutorial and case study on my website- MPLAB X post with some example coding as demonstration. Please visit my post for a bit more details and the whole comparison of output hex generated by Mplab X IDE and the old Mplab.

>>>>>>>>>> MPLAB X IDE Tutorial