logo slogan

MPLab Support from Byte Craft

 

MPLAB, Microchip's IDE, can perform source-level debugging of MPC code. We support both MPLAB 5.x, and MPLAB 6.x and onward.

 

MPLAB 6 support

 

To use MPC 2.0 with MPLAB 6 and later, see this PDF document.

 

MPLAB 5 support

 

These instructions configure older MPLAB software to perform source-level debugging with earlier version of MPC.

 

MPC configuration

Before configuring MPLAB, ensure that the following environment variables are set (probably through your AUTOEXEC.BAT):

 

set INCLUDE=c:\mpc\include  
rem substitute the path to the device  
rem headers directory on your MPC installation    
set LIBRARY=c:\mpc  
rem substitute the path to the MPC  
rem program directory, where mpc12.lib,  
rem mpc14.lib, and mpc16.lib reside  

Restart if necessary.

 

MPLAB configuration

 

To enable support for the Byte Craft compiler within MPLAB, do the following:

  • Select Project|Install Language Tool. From the "Install language tool" window:

    1. Select Byte Craft from the "language" drop box.

    2. Select Assembler/C compiler from the "Tool Name" drop box.

    3. Type in the path and filename of the MPC compiler in the "Executable" text field. Beneath the executable name, select "Command Line".

    Figure 1. Install Language Tool Dialog

  •  

  • keil_kit

 

 

 

 

 

 

 

 

 

 

 

 

 

  • In MPLAB, select Project|New Project.

 

  • From the "New Project" dialog, select the directory and file name for the project.

  • Within the "Edit Project" dialog:

    • Select Byte Craft from the "Language tool suite" drop box.

    • Select your_filename.HEX in the "Project files" area, and select the Node properties button.

      Figure 2. New Project Dialog

 

keil_kit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Within the "Node properties" window:

Select Assembler/C compiler from the "language tool" drop box.

In the "Options" area, choose the following options:

  • Hex Format: select the Intel radio button.

  • Listing file: select the on switch.

  • Error file: select the on switch.

  • Source type: select the C radio button.

You should see +di +l +e -m in the "command line" text field. Choose OK.

Figure 3. Node Properties Dialog

 

 

keil_kit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • Choose Add Node, and add in your source file as a project node. If you do not have a source file yet, be sure to add it in whenever possible.

  • Choose OK. The project is now configured to use Byte Craft's compiler.

Finally, place the following line at the top of your source file:

#pragma option +v;

Once you have completed this procedure, you should be able to perform C source level debugging within the MPLAB IDE.

 

DOS Box problems

 

If the compiler does not exit and close its DOS window, or if MPLAB reports that the compiler has timed out, one of two settings is probably incorrect.

 

If necessary, choose No in the "Build Error" dialog in MPLAB to return to editing. Use ALT+Tab to switch to the MPC.EXE compiler window (an MS-DOS box), and press Control+C to exit the compiler.

To fix the problem, try the following:

 

  1. Within MPLAB, choose Project|Install Language Tool.

  2. Select Byte Craft in the "Language Suite" list.

  3. Ensure that you have selected the "Command Line" option for the compiler, as mentioned above.

  4. If not, select "Command Line" and click OK. Try compiling again.

If that does not fix the problem, do the following:

 

  1. Open the Windows Explorer, and navigate to the MPC program directory.

  2. Select the compiler executable (MPC.EXE), and right-click on it. Choose Properties from the shortcut menu.

  3. In the Properties dialog, choose the Program tab.

  4. If Close on exit is not checked, check it and click OK.

  5. Try compiling again.

If you have problems after using these instructions, please contact support@bytecraft.com.

MPLAB is a trademark of Microchip Technology Inc.