Frequently Asked Questions

How do I make a stand-alone HEX file that runs without the debugger?


A stand-alone HEX file is a program that runs without the debugger. The first step you need to follow before making a stand-alone HEX file that can be programmed into your target is to make sure the debugger is disabled:


  1. If you are using the CCS PCW IDE, make sure the debugger is disabled before you compile the project. If the debugger is open when you compile the project the compiler will force the debugger to be set.

  3. Some PICs have a debug configuration bit. Therefore you need to remove this configuration bit. If you are using the CCS #fuse command you need to remove a line that looks like this:

    #fuse DEBUG

    To be safe you can force the removal of the debug configuration bit with this line:

    #fuse NODEBUG

  5. Make sure you remove this line from your code:

    #device ICD=TRUE

    The previous line will set the debug fuse and move some ROM and RAM around to make the project debugger compatible. You will need to remove it in order for your project to work stand-alone.


If after following the above tips your project still does not run stand-alone without the debugger, be aware that the CCS compiler will set some configuration bits if the debugger is enabled. Some common things the compiler will do in debug mode is: disable power-up timer, disable brownout, disable low voltage programming, disable code write/read protects, etc. Low-voltage programming and brownout-reset are often common problems users have; LVP should almost always be disabled, and if you are not sure then brownout should be disabled.

C-Aware IDE Demo
Embedded C Learners Kit
C Workshop Compiler