User manual
Tutorial
© 2008 Microchip Technology Inc. DS51616B-page 51
4.13.4 Disabling Trace
To temporarily disable the trace capability:
1. Select Project>Build Options>Project, Trace tab. Check “Disable Trace Macros”.
Click OK.
2. Rebuild the project (Project>Build All
).
3. Reprogram the device (Debugger>Program
).
To permanently disable the trace capability:
1. Remove all trace and log macros from code.
2. Select Project>Build Options>Project
, Trace tab. Uncheck “Enable Trace”. Click
OK.
3. Rebuild the project (Project>Build All
).
4. Reprogram the device (Debugger>Program
).
4.14 PROGRAMMING THE APPLICATION
When the program is successfully debugged and running, the next step is to program
the device for stand-alone operation in the finished design. When doing this, the
resources reserved for debug are released for use by the application.
To program the application follow these steps:
1. Disable the MPLAB REAL ICE in-circuit emulator as the debug tool by selecting
Debugger>Select Tool>None
.
2. Enable the MPLAB REAL ICE in-circuit emulator as the programmer by selecting
Programmer>Select Programmer>REAL ICE
.
3. Optional: Set up the ID in Configure>ID Memory
(for devices that support ID
memory.)
4. Set up the parameters for programming on the Programmer>Settings
, Program
Memory tab.
5. On the Project toolbar, select “Release” from the Build Configuration drop-down
list. Then select Project>Build All
.
6. Select Programmer>Program
.
The application should now be running on its own. Press the Reset (MCLR
) button on
the demo board to restart the count.
You can modify the program code to wait for a button press before beginning or to
terminate the program. Modifying the program will require you to select the emulator as
a debug tool.
1. Disable the MPLAB REAL ICE in-circuit emulator as the programmer by select-
ing Programmer>Select Programmer>None
.
2. Enable the MPLAB REAL ICE in-circuit emulator as the debug tool by selecting
Debugger>Select Tool>REAL ICE
.
3. Edit the counter.c code as desired. (This is left as an exercise for you.)
4. On the Project toolbar, select “Debug” from the Build Configuration drop-down
list. Then select Project>Build All
.
5. Select Debugger>Program
.
6. Run, step and debug your program as required.