PC Profiling – 32-Bit MCUs Only

For PC profiling, every program counter (PC) trace sample is taken from the trace (data) buffer and profiled. This data is displayed in the PC Profiling window, as shown in Figure 2. In this example, the trace buffer contains 21,000 PC sample data points. Of these, 7859 (or 37.42%) were associated with the main() function, 6023 (or 28.68%) with the subrA() function, etc.


Currently, to use PC profiling your project must be set up for these supported devices:

Profiling Setup

To set up profiling:

  1. Set up your hardware for PIC32 Instruction trace (see Instruction Trace Connections.)
  2. Open the Project Properties window (File > Project Properties).
  3. Click on “REAL ICE” under “Categories” and select “Trace and Profiling” from the “Options categories” drop-down box.
  4. Under “Data Collection Selection”, select “Instruction Trace/Profiling”.
  5. Set up your data file in this window. For reference, see Trace and Profiling Options.
  6. Click OK.

Figure 1: PC Profiling – Selection and Setup



To generate data:

  1. Select Window > Debugging > PC Profiling. This will open the PC Profiling window.
  2. Run your code and then pause/halt.
  3. View the profiling data in the window. Data is only displayed on halt.
  4. Right-click in the window to pop up a menu to either clear the data or reload the data.

You may also display this data in the Code Profiling plugin, available for purchase at

Figure 2: PC Profiling Window

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.