5.17.1 Choose Hardware or Software Breakpoints

Hardware breakpoints use device resources, that is internal registers, to perform a code break or halt. Therefore the number of breakpoints varies by device.

Software breakpoints replace an opcode instruction with one that causes a break or halt. Therefore the number of breakpoints is unlimited.

To help you decide which type of breakpoints to use (hardware or software) the following table compares the features of each.

Table 5-11. Hardware vs. Software Breakpoints
Feature Hardware Breakpoints Software Breakpoints
Number of breakpoints Limited Unlimited
Breakpoints written to* Internal debug registers Flash Program Memory
Breakpoints applied to** Program Memory/Data Memory Program Memory only
Time to set breakpoints Minimal Dependent on oscillator speed, time to program Flash Memory and page size
Breakpoint skidding Most devices. See the “Breakpoints” section under General Debug Limitations for details. No

* Where information about the breakpoint is written in the device.

** What kind of device feature applies to the breakpoint. This is where the breakpoint is set.

To select hardware or software breakpoints:

  1. Right click on the project name and select “Properties.”
  2. In the Project Properties dialog, select the hardware tool (PKOB nano) under “Categories.”
  3. Under “Option Categories” select “Debug Options.”
  4. Check “Use software breakpoints” to use software breakpoints. Uncheck to use hardware breakpoints.
    Note: Using software breakpoints for debug impacts device endurance. Therefore, it is recommended that devices used in this manner not be used as production parts.