Hardware Address/Data Breakpoints

Last modified by Microchip on 2023/12/20 21:08

Up to 32 hardware address/data breakpoints are available to use on the emulation header (see also Runtime Watch, Breakpoint and Trace Resources). Software breakpoints are useful, but real hardware breakpoints are incomparable when you need unfettered control of qualifying the breakpoint/event conditions beyond the simple address matching. Consider the addition of a special interrupt contextual qualifier and these hardware breakpoints offer a high degree of configurability.

Emulation header hardware breakpoints can trigger without halting the execution and could be used as trigger events to other features.

Breakpoint Setup

Address/Data Breakpoints may be found and set up on the New Breakpoint Dialog (Debug > New Breakpoint) by choosing either Address or Data as the Breakpoint Type. After the breakpoint is created, it can be edited by right-clicking and selecting Customize. For details, see the MPLAB® X IDE documentation.

Back to Top

Range Breakpoints

A breakpoint may be specified to occur with a range of program or data memory. A start address and then an end address are specified for the breakpoint. Then the break condition is selected.

The dialog items used to set up range breakpoints are described below.

ItemDescription
Enable Range AddressCheck to set a range breakpoint.
Address (Start)Enter a starting hexadecimal memory address.
Address (End)Enter an ending hexadecimal memory address.
Breaks onSpecifies the conditions of the break.
Conditions differ for address memory and data memory.

Back to Top

Data Value Comparison

Data memory breakpoints may be set up to compare a Break on value to another value before breaking.

The dialog items used to set up data value comparison are described below.

ItemDescription
Breaks onSpecifies the conditions of the break.
ValueFor the “Breaks on” selection of:
- Read Specific Value
- Write Specific Value
- Read or Write Specific Value
Enter a hexadecimal value here.
Value ComparisonCompare to “Value” as specified:
= Value: Equal to value
~
 Value: Not equal to value
> Value: Greater than value
< Value: Less than value

Back to Top

Data Value Mask

Data memory breakpoints may be set up to compare a masked “Break on” value to another value before breaking.
To set up a value comparison, see “Data Value Comparison”.

The dialog items used to set up a data value mask are described below.

ItemDescription
Data Value MaskUse mask when comparing to “Value”.
Enter a value in the range 0x00 to 0xhh, where:
0x00: No bits compared
0xhh: All bits compared

Back to Top

Pass Count Operation

Using a pass count allows you to delay breaking until after a specified count.

Event must occur Count times. Count is the number of times you will pass the breakpoint before stopping. E.g.:

  • 0 means execution will stop immediately
  • 1 means execution will pass once then stop the next time (stop on second time)
  • 10 means execution will pass 10 times and stop the next time (stop on eleventh time)

The dialog items used to set up a pass count operation are found in the “Pass count” section of the dialog and are described below.

ItemDescription
ConditionDetermine when the break specified under “Breaks on” occurs.
Always Break: Always break when the “Breaks on” condition is met.
Event must occur Count times: An event (“Breaks on” condition)
must occur Count times before actually breaking.

Back to Top

Trigger Out Operation

A trigger out pulse can be generated when an address or data breakpoint is reached. For more on triggers, see “Trigger In/Out”.

The dialog item used to set up trigger out operation is described below.

ItemDescription
Trigger OptionsSelect when to trigger, either:
- Do not emit a trigger out pulse when breakpoint is hit
- Emits a trigger out pulse when breakpoint is hit

Back to Top

Interrupt Context Detection

An address or data breakpoint can be set based on the context of an interrupt. You can set up the breakpoint so it only breaks when it is in the interrupt section of code (ISR), only when it is in main line code, or when it is in either ISR or main code. This can assist when attempting to narrow down issues in code regions.

Address/Data Breakpoints may be found and set up on the New Breakpoint Dialog (Debug > New Breakpoint) by choosing either Address or Data as the Breakpoint Type. After the breakpoint is created, it may be edited by right-clicking and selecting Customize.

The dialog item used to set up interrupt context is described below.

ItemDescription
Interrupt ContextInterrupt Context qualifier for address/data breakpoints. Select from:
Always break - break in both ISR and main code
Break in main line (non-interrupt) context only - break in main code only
Break in interrupt context only - break in ISR code only

Back to Top