Blog

Tips and Tricks for Getting Started with MPLAB

Tips and Tricks for Getting Started with MPLAB

MPLAB, an IDE developed by Microchip Technology, has many effective functionalities but can be tricky to use at times. Below, I’ve compiled a list of my favorite tips, common gotchas, and the best ways to troubleshoot MPLAB.

Adding and Removing Files From a Project

Whenever you add or remove files from a project, you should do so within the IDE. This method the is quickest because MPLAB automatically adds the linking when you create them in the IDE.  When creating header and source files, make sure they are put into the correct folder, as MPLAB has another way of sorting the files and it’s important that they are in their respective directories.

Excluding Files From Build Configuration

By default, MPLAB compiles all files into the project folder. So, if you have other files in your directory, you will need to exclude them.

To remove files from the build configuration, first go to Project Properties under the File menu.

MPLAB project properties drop down menu

Then, go to the File Inclusion/Exclusion tab.

MPLAB Inclusion and Exclusion list

Here, you can select which files you want to be compiled when building a certain configuration. 

If there are still files you want to exclude but aren’t showing in this menu, make sure they’re also in the project files tab. To do this, navigate to the Project Files tab and right-click the file you want to exclude. Click Exclude files from current configuration in the pop-up menu.

MPLAB project files tab to exclude files

Common MPLAB Compiler Problems and Solutions

  • Problem: ICD isn't recognized as a debugger in the MPLAB IDE.
    • Solution: Restart MPLAB
       
  • Problem: When trying to debug a program this error appears: "Unknown Error Occurred! - Message text was NULL.  The debugger could not be started.  Terminating debug session."
    • Solution: Unplug ICD and restart MPLAB
       
  • Problem: You receive this error: “Error: The program file could not be loaded: null.”
    • Solution: Reboot MPLAB
       
  • Problem: You receive this error: " Verify Failed. [ Pgm ] at 0x0, expected 0x0040200, got 0x00000000. You have set program speed to Normal. The circuit on your board may require you to slow the speed down. Please change the setting in the tool properties to low and try the operation again. Programming did not complete."
    • Solution: Make sure the board is powered on
       
  • Problem: In general, something isn't working.
    • Solution: Unplug ICD and/or Restart MPLAB

Explore other IDE Options

MPLAB is great to build and debug programs. Sometimes, however, I prefer to use an IDE with a familiar coding environment. Some IDEs I recommend are Eclipse and VS Code—both are powerful software and intuitive to use.

Learn more about DMC’s application development expertise and contact us to get started on your next project.

Comments

There are currently no comments, be the first to post one.

Post a comment

Name (required)

Email (required)

CAPTCHA image
Enter the code shown above:

Related Blog Posts