PC Sampling: 8- and 16-Bit MCUs Only

For PC sampling, a device timer is set up to take samples of program execution and display the results in the PC profiling window.

Requirements

Currently, to use PC sampling your project must be set up for:

  • a supported device:
    • PIC18F with data capture – To find out if your device has data capture, please see Hardware Tool Debug Features by Device.
    • PIC24F, PIC24EP
    • dsPIC33FJ, dsPIC33E
    • Note: PIC16F1 devices are NOT supported
  • an MPLAB® XC8 or MPLAB XC16 C Compiler version 1.10 or above

Clock Setup

To set up the clock:

  1. Open the Project properties window (File > Project Properties).
  2. Click on “REAL ICE™” under “Categories” and select “Clock” from the “Options categories” drop-down box. Ensure this value matches the actual target speed, i.e., as set by the Configuration bits in code.
  3. Click Apply.

Sampling Setup

To set up sampling:

  1. Click on “REAL ICE” under “Categories” and select “Trace and Profiling” from the “Options categories” drop-down box.
  2. Under “Data Collection Selection”, select “PC Sampling”.
  3. Set up your data file and timer in this window. For reference, see Trace and Profiling Options.
    Note: Ensure the timer you select is not used in your program.
  4. Click OK.

Figure 1: PC Sampling – Selection and Setup

X_PP_8and16BitProfiling.gif

Operation

To generate data:

  1. Select Window > Debugging > PC Profiling. This will open the PC Profiling window.
  2. Run your code and then halt.
  3. View the sampling 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
http://www.embeddedcodesource.com

Figure 2: PC Sampling – PC Profiling Window

8and16Bit_PCSampling.gif
© 2017 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.