Operation
Typically, in order to find out if an application program will run correctly, a breakpoint is
set early in the program code. When a breakpoint is set from the user interface of
MPLAB IDE, the address of the breakpoint is stored in the special internal debug
registers of the target device. Commands on PGC and PGD communicate directly to
these registers to set the breakpoint address.
Next, the Debugger>Run function or the Run icon (forward arrow) is usually pressed
from MPLAB IDE. The emulator will raise the V PP /MCLR line to allow the target to run,
the target will start from the Reset vector and execute until the Program Counter
reaches the breakpoint address previously stored in the internal debug registers.
After the instruction at the breakpoint address is executed, the in-circuit debug
mechanism of the target device “fires” and transfers the device’s Program Counter to
the debug executive (much like an interrupt) and the user’s application is effectively
halted. The emulator communicates with the debug executive via PGC and PGD, gets
the breakpoint status information and sends it back to MPLAB IDE. MPLAB IDE then
sends a series of queries to the emulator to get information about the target device,
such as file register contents and the state of the CPU. These queries are ultimately
performed by the debug executive.
The debug executive runs just like an application in program memory. It uses some
locations on the stack (usually just one or two) and, typically, about fourteen file
registers for its temporary variables. If the device does not run, for whatever reason,
such as no oscillator, a faulty power supply connection, shorts on the target board, etc.,
then the debug executive cannot communicate to the MPLAB REAL ICE in-circuit
emulator and MPLAB IDE will issue an error message.
Another way to get a breakpoint is to press the MPLAB IDE’s Halt button (the “pause”
symbol to the right of the Run arrow). This toggles the PGC and PGD lines so that the
in-circuit debug mechanism of the target device switches the Program Counter from the
user ’s code in program memory to the debug executive. Again, the target application
program is effectively halted, and MPLAB IDE uses the emulator communications with
the debug executive to interrogate the state of the target device.
2.8
PROGRAM MODE
When using the Programmer>Program selection to program a device, MPLAB IDE will
disable the in-circuit debug registers so the MPLAB REAL ICE in-circuit emulator will
program only the target application code and the Configuration bits (and EEPROM
data, if available and selected) into the target device. The debug executive will not be
loaded. In this mode the emulator can only toggle the MCLR line to reset and start the
target. A breakpoint cannot be set, and register contents cannot be seen or altered.
The MPLAB REAL ICE in-circuit emulator system programs the target using ICSP. No
clock is required while programming, and all modes of the processor can be
programmed, including code protect, Watchdog Timer enabled and table read protect.
Note:
? 2006 Microchip Technology Inc.
A header board is required to debug some devices. These parts can be
programmed without the header by connecting the V PP , PGC and PGD
lines as described previously.
DS51616A-page 19
相关PDF资料
AC2626M6 PROBE TEMP 6" GENERAL PURP
AC300024 MOTOR STEPPER 2PHASE 8WIRE
AC300030 KIT ACOUSTIC ACCESSORY
ACM-16 CABLE MODULE FR3 16BIT 40-DIP
ACM-2X8 ACTIVE CABLE MODULE DUAL 8 BIT
ACM-8 CABLE MODULE FR3 8BIT 28/32-DIP
ACS9510EVB EVALUATION BOARD FOR ACS9510
ACS9550EVB EVALUATION BOARD FOR ACS9550
相关代理商/技术参数
AC244007 制造商:Microchip Technology Inc 功能描述:MPLAB REAL ICE JTAG ADAPTER - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:ADAPTER MPLAB REAL ICE JTA 制造商:Microchip Technology Inc 功能描述:ADAPTER, MPLAB, REAL, ICE, JTAG 制造商:Microchip Technology Inc 功能描述:ADAPTER, MPLAB, REAL, ICE, JTAG; Accessory Type:JTAG adaptor Board; For Use With:Microchip PIC32MX devices; SVHC:No SVHC (19-Dec-2012) ;RoHS Compliant: Yes
AC244008 功能描述:处理器配件 MPLAB REAL ICE Power Monitor RoHS:否 制造商:Olimex Ltd. 产品:Cable 用于:
AC244022 功能描述:插座和适配器 Procs Extnsn Pak for PIC24FJ128GA010-ICE RoHS:否 制造商:Silicon Labs 产品:Adapter 用于:EM35x
AC244022 制造商:Microchip Technology Inc 功能描述:Processor Extension Pak for PI
AC244023 功能描述:插座和适配器 PROCESSOR EXTNSN PAK FOR PIC18F1xK50 RoHS:否 制造商:Silicon Labs 产品:Adapter 用于:EM35x
AC244024 功能描述:插座和适配器 Processor Ext Pak for PIC18LF14K50 RoHS:否 制造商:Silicon Labs 产品:Adapter 用于:EM35x
AC244026 功能描述:插座和适配器 Processor Ext Pak (PIC16F727-ICE) 200K RoHS:否 制造商:Silicon Labs 产品:Adapter 用于:EM35x
AC244027 功能描述:插座和适配器 Processor Ext Pak (PIC16LF727-ICE)200K RoHS:否 制造商:Silicon Labs 产品:Adapter 用于:EM35x