Tutorial
2.7
DEBUGGING THE CODE
The MPLAB ICD 2 debugger/programmer can be used to run, halt, and step the code.
You can set a breakpoint so that program execution halts after the code has executed
the instruction at the breakpoint. A green arrow points to the next line to be executed.
The contents of the RAM and registers can be viewed when the processor has been
halted.
MPLAB ICD 2 uses the following function keys to access the main debugging functions:
<F5>
<F6>
<F7>
<F9>
Halt
Reset
Single Step
Run
There are more functions available by right clicking on a line of source code. The most
important of these are Set Breakpoint and Run to Cursor .
2.7.1
Display the Code
1. From the View menu, select Program Memory . The Program Memory window
displays.
2. Select the Symbolic tab at the bottom of the window.
3. Press <F5> to halt the processor. The program stops and the green arrow points
to the next instruction, as shown in Figure 2-19.
FIGURE 2-19:
PROGRAM HALTED
4. Press <F6> to reset the program. The green arrow moves to address 00000, the
goto _reset instruction, as shown in Figure 2-20. The linker inserted this
instruction to make the program branch to the start of the code.
FIGURE 2-20:
? 2004 Microchip Technology Inc.
PROGRAM RESET
DS51471A-page 27
相关PDF资料
DM300014 BOARD DEMO DSPICDEM 1.1 GEN PURP
DM300016 BOARD DEMO DSPICDEM STARTER
DM300017 BOARD DEMO DSPICDEM STARTER
DM300020 BOARD DEV DSPICDEM MC1 MOTORCTRL
DM300021 MODULE PWR DSPICDEM MC1H HV 3PHS
DM300022 MODULE PWR DSPICDEM MC1L LV 3PHS
DM320002 BOARD EXPANSION PIC32 I/O
DM320003-2 KIT EVAL PIC32 USB II STARTER
相关代理商/技术参数
DM300014 功能描述:开发板和工具包 - PIC / DSPIC dsPICDEM 1.1 GP RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM300015 功能描述:KIT DESIGN W/DM300014 RoHS:否 类别:编程器,开发系统 >> 过时/停产零件编号 系列:- 标准包装:1 系列:*
DM300016 功能描述:开发板和工具包 - PIC / DSPIC dsPICDEM Starter RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM300017 功能描述:开发板和工具包 - PIC / DSPIC dsPICDEM 28P Starter RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM300017 制造商:Microchip Technology Inc 功能描述:Microcontroller Development To
DM300018 功能描述:开发板和工具包 - PIC / DSPIC dsPICDEM 2 Demo Brd RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM300018 制造商:Microchip Technology Inc 功能描述:DEMO BOARD ((NW))
DM300019 功能描述:开发板和工具包 - PIC / DSPIC dsPICDEM 80L Starter Demo Board RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压: