PICkit™ 2 Debug Express
©
2006 Microchip Technology Inc.
DS51553B-page 35
4.2.10
Debugging the PIC16F917 Debug Demo Code
Any of the following issues can prevent the PIC16F917 Debug Demo program from
working properly:
• The A/D converter value is not being written properly to the Delay routine.
• The A/D converter is not enabled or has not been set to convert.
• A typing error in the source code has caused the program to function improperly.
To explore the first listed possible issue, set a breakpoint at the line of code that writes
the value of the A/D result to the high-order Delay byte:
1.
Highlight the following line of code in the
PIC16F917 Debug Demo.asm
file:
“
movwf Delay+1
”, as shown in Figure 4-21.
At this breakpoint, the program will stop once the A/D conversion has completed.
2.
Right click to display a drop-down menu.
3.
Select Set Breakpoint from the drop-down menu.
The program marks the line with the letter B in a red octagon outline, as shown
in Figure 4-21.
FIGURE 4-21:
BREAKPOINT
4.
Select Debugger > Run, or click the Run button to run the program in Real-Time
mode.
A breakpoint stops a program’s execution when the program executes the line
marked as a breakpoint.
5.
Hover over “ADRESH” in the listing file and it will show the value of the file
register (see Figure 4-22).
Содержание PICkit 2
Страница 2: ...2006 Microchip Technology Inc DS51553B PICkitTM 2 Microcontroller Programmer USER S GUIDE...
Страница 45: ...PICkit 2 User s Guide DS51553B page 40 2006 Microchip Technology Inc NOTES...
Страница 47: ...PICkitTM 2 User s Guide DS51553B page 42 2006 Microchip Technology Inc NOTES...
Страница 52: ...2006 Microchip Technology Inc DS51553B page 47 PICkit 2 User s Guide NOTES...