In-Circuit Debug (ICD) Interaction

The scanner freezes when an ICD halt occurs, and remains frozen until user-mode operation resumes. The debugger may inspect the SCANCON0 and SCANLADR registers to determine the state of the scan.

The ICD interaction with each operating mode is summarized in the following table.

Table 1. ICD and Scanner Interactions
ICD Halt Scanner Operating Mode
Peek Concurrent
Triggered Burst
External Halt If scanner would peek an instruction that is not executed (because of ICD entry), the peek will occur after ICD exit, when the instruction executes. If external halt is asserted during a scan cycle, the instruction (delayed by scan) may or may not execute before ICD entry, depending on external halt timing. If external halt is asserted during the BSF(SCANCON.GO), ICD entry occurs, and the burst is delayed until ICD exit.

Otherwise, the current NVM-access cycle will complete, and then the scanner will be interrupted for ICD entry.

If external halt is asserted during the cycle immediately prior to the scan cycle, both scan and instruction execution happen after the ICD exits. If external halt is asserted during the burst, the burst is suspended and will resume with ICD exit.
PC Breakpoint Scan cycle occurs before ICD entry and instruction execution happens after the ICD exits. If PCPB (or single step) is on BSF(SCANCON.GO), the ICD is entered before execution; execution of the burst will occur at ICD exit, and the burst will run to completion.

Note that the burst can be interrupted by an external halt.

Data Breakpoint The instruction with the dataBP executes and ICD entry occurs immediately after. If scan is requested during that cycle, the scan cycle is postponed until the ICD exits.
Single Step If a scan cycle is ready after the debug instruction is executed, the scan will read PFM and then the ICD is re-entered.
SWBP and ICDINST If scan would stall a SWBP, the scan cycle occurs and the ICD is entered. If SWBP replaces BSF(SCANCON.GO), the ICD will be entered; instruction execution will occur at ICD exit (from ICDINSTR register), and the burst will run to completion.