Frequently Asked Questions

HOW DOES IT WORK?

  • What's in the silicon that allows it to communicate with the MPLAB® ICD 4 In-Circuit Debugger?
    MPLAB® ICD 4 In-Circuit Debugger can communicate with Flash silicon via the In-Circuit Serial Programming™ (ICSP™) interface. It uses the debug executive located in test memory. For legacy 8-bit devices, the debug executive resides in Program memory.
  • How is the throughput of the processor affected by having to run the debug executive?
    The debug executive doesn't run while in Run mode, so there is no throughput reduction when running your code, i.e., the debugger doesn’t "steal" any cycles from the target device.
  • How does MPLAB X IDE interface with the MPLAB ICD 4 In-Circuit Debugger to allow more features than older debuggers?
    MPLAB ICD 4 In-Circuit Debugger communicates using the debug executive located in the test area. The debug executive is streamlined for more efficient communication. The debugger contains an FPGA, large SRAM Buffers (1Mx8), and a High-Speed USB interface. Program memory image is downloaded and is contained in the SRAM to allow faster programming. The FPGA in the debugger serves as an accelerator for interfacing with the device in-circuit debugger modules.
  • On traditional debuggers, the data must come out on the bus in order to perform a complex trigger on that data. Is this also required on the MPLAB ICD 4 In-Circuit Debugger? For example, could I halt, based on a flag going high?
    Traditional debuggers use a special debugger chip (-ME) for monitoring. There is no -ME with the MPLAB ICD 4 In-Circuit Debugger, so there are no busses to monitor externally. With the MPLAB ICD 4 In-Circuit Debugger, rather than using external breakpoints, the built-in breakpoint circuitry of the debug engine is used. The busses and breakpoint logic are monitored inside the part.
  • Does the MPLAB ICD 4 In-Circuit Debugger have complex breakpoints?
    Yes. You can break based on a value in a data memory location. You can also do sequenced breakpoints, where several events have to occur before it breaks. However, you can only do two sequences. You can also do the AND condition and do PASS counts.
  • What limitations are there with the standard cable?
    The standard ICSP-RJ11 cable maximum clock frequency is approximately 15 MHz. Device interrogation during debugging occurs at frequencies below this rate regardless of the CPU clock rate. However, some advanced functions are synchronous to the CPU bus cycle (like instrumented trace and data capture). During data capture and when the CPU runs at its highest speed (40 MIPS for example), the actual clock rate through the cable would exceed 15 MHz. In these instances, trace and data capture cannot run reliably and the ICSP-RJ11 cable cannot be used.
  • Will this slow down the running of the program?
    There is no cycle stealing with the MPLAB ICD 4 In-Circuit Debugger. The output of data is performed by the state machine in the silicon.
  • Is it possible to debug a dsPIC DSC running at any speed?
    The MPLAB ICD 4 is capable of debugging at any device speed as specified in the device’s data sheet.

WHAT’S WRONG?

  • Performing a Verify fails after programming the device. Is this a programming issue?
    If 'Run Main Project' is selected, the device will automatically run immediately after programming. Therefore, if your code changes the flash memory, verification could fail. To prevent the code from running after programming, select 'Hold in Reset'.
  • My computer went into power-down/hibernate mode, and now my debugger won’t work. What happened?
    When using the debugger for prolonged periods of time, and especially as a debugger, be sure to disable the hibernate mode in the power options dialog window of your computer’s operating system. Go to the hibernate tab and clear or uncheck the enable hibernation checkbox. This will ensure that all communication is maintained across all the USB subsystem components.
  • I set my peripheral to NOT freeze on halt, but it is suddenly freezing. What's going on?
    For dsPIC30F/33F and PIC24F/H devices, a reserved bit in the peripheral control register (usually either bit 14 or 5) is used as a Freeze bit by the debugger. If you have performed a write to the entire register, you may have overwritten this bit. (The bit is user-accessible in Debug mode.) To avoid this problem, write only to the bits you wish to change for your application (BTS, BTC) instead of to the entire register (MOV).
  • When using a 16-bit device, an unexpected Reset occurred. How do I determine what caused it?
    Some things to consider:
    • To determine a Reset source, check the RCON register.
    • Handle traps/interrupts in an Interrupt Service Routine (ISR). You should include trap.c style code, e.g.,
void __attribute__((__interrupt__)) _OscillatorFail(void);
:
void __attribute__((__interrupt__)) _AltOscillatorFail(void);
:
void __attribute__((__interrupt__)) _OscillatorFail(void)
{
INTCON1bits.OSCFAIL = 0; //Clear the trap flag

while (1);
}
:
void __attribute__((__interrupt__)) _AltOscillatorFail(void)
{
INTCON1bits.OSCFAIL = 0;
while (1);
}
:
  • Use ASSERTs. For example:
 ASSERT (IPL==7)
© 2024 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.