Using MPLAB with HI-TECH compilers

Using Microchip MPLAB® with HI-TECH C® compilers

HI-TECH C® compilers are fully compatible with MPLAB® through the use of a tool suite plug-in. The tool suite plug-in is provided below, but before proceeding please check the following:

    • When using PICC 9.50 under MPLAB, you will see one or both of the following messages:
        Advisory[1207]   : Some of the command line options you are using are now obsolete.
      					
        Advisory[1209]   : An old MPLAB tool suite plug-in was detected.
                           Some options may not work correctly
      							  
    • The newest toolsuite available is still "old", but still functions fine. The "new" one isn't finished yet - an announcement will be posted in our discussion forum when it is ready.
    • If you are using MPLAB v5.xx or earlier, please go to the MPLAB v5.xx integration page.
    • If you are using MPLAB v6.xx, be sure that it is at least v6.50. You can download the latest version from Microchip's website. (version 7.xx is OK)

MPLAB Tool suite plug-in

The following download will install the tool suite plug-in and integrate the compiler with MPLAB.

Please note that this will only work with the following compiler versions:

    • PICC v8.02 or higher
    • PICC Lite v8.02 or higher
    • PICC-18 v8.20 or higher
    • All versions of HI-TECH C for dsPIC/PIC24
    • All versions of PICC Enterprise Edition

If your compiler is one of the above, then download and run the following:

MPLAB tool suite integration

This will perform all the necessary steps to get your compiler working with MPLAB.
If your compiler is older than the versions mentioned above, then you will need to update your compiler, or use an older version of MPLAB (v5.xx).

Special notes about compiler options:

    • Be careful when selecting your build options as some of the options offered will guarentee MPLAB reporting a build failure. The reason for this is that some options do not follow though to the link stage and MPLAB has no facility to cater for this. So unless it is your explicit intention to do so, DO NOT select any of these options: -S (compile to assembly only),
      -PROTO (generate function prototypes)
      -PRE (generate preprocessed source)
    • When configuring the compiler options it can be very useful (for debugging purposes) to generate an assembler list file and a map file. Assembler list files contain a mixture of your original C source code and the generated assembler code. Map files contain all information about how your code has been positioned in memory. Map files also contain a call graph which shows your stack usage.
    • If you are having problems with your program fitting into the available ROM/FLASH space, don't forget to turn on the compiler's optimizations. Compiler optimizations will attempt to reduce your program's code requirements without effecting the way it operates. There are two types of optimizations: global optimizations and assembler optimizations. To enable these, select them from the Compiler tab for C files, or from the Assembler tab for AS files.

Debugging your code

If your program has been built correctly, the compiler should generate a HEX file and a COF file. The COF file contains all the information necessary for high-level debugging and MPLAB should load this automatically after building. If you have used some other method of building your project, you can import this COF file into MPLAB at any time by selecting Import... from the File menu.