14.10.7 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 14-3. ICD and Scanner Interactions
ICD HaltScanner Operating Mode
PeekConcurrent
TriggeredBurst
External HaltIf the scanner will peek an instruction that is not executed (because of ICD entry), the peek will occur after ICD exit, when the instruction executesIf 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 timingIf 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 exitsIf external halt is asserted during the burst, the burst is suspended and will resume with ICD exit
PC BreakpointScan cycle occurs before ICD entry and instruction execution happens after the ICD exitsIf 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 BreakpointThe 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 StepIf 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 ICDINSTIf the scan stalls a SWBP, the scan cycle occurs and the ICD is enteredIf 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