{"id":520,"date":"2014-07-18T13:54:38","date_gmt":"2014-07-18T12:54:38","guid":{"rendered":"http:\/\/www.kanda.com\/blog\/?p=520"},"modified":"2017-01-26T12:27:30","modified_gmt":"2017-01-26T11:27:30","slug":"mplab-good","status":"publish","type":"post","link":"https:\/\/www.kanda.com\/blog\/microcontrollers\/pic-microcontrollers\/mplab-good\/","title":{"rendered":"Is MPLAB X Any Good?"},"content":{"rendered":"

I am an occasional user of MPLAB because we mainly use AVR microcontrollers in our products but recently we have done a lot with PIC microcontrollers. This gave the opportunity to compare MPLAB 8.70 and MPLAB X to decide which to use in the future, so we thought we would share our findings with you.<\/p>\n

<\/p>\n

Microchip still distribute MPLAB 8.70 CDs with PICKit2 and PICKit3 debugger\/programmer tools, which we use in our PIC training kits, so it looks like we should stick with this. However, this CD has a bug with auto-run that means you have to install manually by running setup.exe. You also have to do a custom install to remove C32 Compiler as this gives a corrupt cab file error. Not a great user experience!<\/p>\n

This CD contains Hi-tech C compiler that is installed as part of MPLAB but the version of 8.70 that can be downloaded from Microchip seems to omit this. This means you have to also download the new Microchip XC compiler as well. The good news is that this can be used with MPLAB 8.70 and this one compiler supports PIC12, PIC16 and PIC18 series.<\/p>\n

Having gone to all this trouble to install MPLAB 8.70 with a working C compiler, wouldn’t it be easier to just download and install MPLAB X? It might be a 370MB file plus another 155 MB for XC compiler but most of us have reasonable downloads now.<\/p>\n

We bit the bullet and downloaded it, without any problems once we worked out that we needed XC8 version of the compiler – it is a bit lost on a complicated downloads page.<\/p>\n

First impressions were good. It has a nice layout and windows dock properly. It also runs smoothly on fairly slow PCs, which is more than can be said for Atmel’s AVRStudio 7!<\/p>\n

As all our code is in MPLAB 8 format, the first step was to see how easy it is to convert existing projects and we were pleasantly surprised. You just choose File -> New Project<\/strong> and select Existing MPLAB IDE v8 Project<\/em>. Then select device, debug tool and assembler or C compiler.<\/p>\n

There is no Build or Project menu, which was surprising but we found Build and Clean in Run menu. Assembler files build without any issues as you can select mpasm as the assembler so we could just save the new MPLAB X project.<\/p>\n

C projects gave issues with Configuration Bits as the XC8 compiler doesn’t support __CONFIG or CONFIG directives. Instead it uses the #pragma config directive. It is actually easy to generate these once you have found the tool that does it, as it is well hidden in Window menu -> PIC Memory Views -> Configuration Bits.<\/strong> Otherwise, they all built fine.<\/p>\n

Here is a list of the annoying quirks we found in MPLAB X:<\/p>\n