hello, everyone
I am developing application using PIC18f4620
My framework: MPLAB IDE v8.70, mcc18 v3.31, and Microchip PICkit3
- The first, I set pickit3 as programmer (in mplab ide, I seleced "Programmer>select Programmer>PICkit3"):
Now, I programed it (programmer>program). it was successful.
and then I ran it. My application ran correctly.
- Now, I want to use PICkit3 for debugging
+ close PICkit3 in Programmer mode (Programer>select Programmer>none)
+ Set PICkit3 as Debugger (Debugger>select tool>PICkit3)
+ I recompiled application with DEBUG mode (Project>Build configuration>Debug)
+ reprogram application (Debugger>program)
+ now, I run debugging (Debugger>run or press "F9"):
the following error raised:
"PK3Err0040: The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding."
I solved this problem as following:
- recheck PICkit3's debug support for pic18f4620 through "Select Device" window (configure>select device...): in debuggers, PICkit3 led indicator is green. So pic18f4620 is supported by pickit3
- My configure code is:
#pragma config WRTC = OFF //Configuration Register Write Protection
#pragma config DEBUG = ON //Background Debugger Enable
#pragma config WDT = OFF //WDT disabled (enabled by SWDTEN bit)
#pragma config OSC = HSPLL
#pragma config BOREN = OFF //Brown-out Reset is Disabled
#pragma config PBADEN = OFF //PORTB<4:0> digital on Reset
#pragma config LVP = OFF //Low Voltage ICSP is disabled

I don't understand why it is false.
Please suggest me the solution. thank you very much!