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.
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!
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.
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.
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.
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!
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 and select Existing MPLAB IDE v8 Project. Then select device, debug tool and assembler or C compiler.
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.
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. Otherwise, they all built fine.
Here is a list of the annoying quirks we found in MPLAB X:
- Build is under Run menu
- To close a project, you need to highlight it first in Project window
- With New Project, it won’t create a new folder
- New empty files aren’t found unless you manually add a file extension, .c or .asm
- Output Window isn’t cleared when you change project and gets cluttered – right click to clear it
- No Animate in Debug
These are minor issues and you soon get used to them. In conclusion, we have swapped to MPLAB X with all our PIC microcontroller kits for these reasons
- MPLAB 8.70 CD is buggy
- MPLAB X supports both PICKit 2 and 3
- MPLAB 8 projects convert easily
- XC8 Compiler is easily integrated and supports 12,16 and 18 series
- Support and licence for Hi-Tech C compiler seems to be going
- User interface is better
- It installs a separate programmer utility on desktop
- It runs fine on slower PCs
All in all, now seems to be a good time to swap even though Microchip are still distributing MPLAB 8.70 with their tools. Our PIC microcontroller programming kits all use MPLAB X now and XC8 compiler.
Our latest PIC starter kit uses the latest PIC16F1789, which is much better than older PIC chips like PIC16F877. It has tutorials and sample code on all aspects of using MPLAB X, writing programs in assembler and C and much more.
Microchip MPLAB X and XC8 Compiler Downloads