PICkit2 not entering debug mode

Status
Not open for further replies.

yohanevindra

New Member
I've been using PICs with the PICDEM board, and thought i'll start using with a PICkit2/3 on a breadboard.

I have my own power supply of 5V which is regulated using a LM7805, and connected the Vdd and Vss of the PIC, and made the connections from the PICkit2 to the PIC. (I had the diagram from the PICkit3, so I assume its the same?)

After powering up the device and connecting it to the PC, when I try to run my program I get an error telling me that the PICkit2 cant enter debug mode. I dont have an external oscillator..

I have a 4MHz crystal but didnt fix it since I dont have the proper capacitors to connect it with as stated in the datasheet. Also, how do i know which oscillator mode to run the PIC with?

The sheet with the PICkit3 says that I need an oscialltor to enter debug mode..is that the same for the PICkit2?

EDIT: I still want to know how to get to work in debug mode, but i used it as a programmer, and then i disconnected it from the PIC. and then I disconnected the power, and switched it back on to the PIC. Its a simple program jus to light two LEDs on. After connecting the power, it took about a second or 2 to light the LEDs. Is that normal?
 
Last edited:
hi,
I dont use the PICDEM pcb, but regarding the 4mHz crystal, fit it to the pcb it may run OK without the caps, also choose XT mode.
 
so without the caps, jus connect the crystal and use it in XT mode?will try that you and let you know how it goes..come to tihnk of it, other projects on breadboards i've never seen caps with the crystal..

i need to define the CONFIG register at the begining right?or do i use
Code:
#pragma CONFIG .......
 
hi,
I dont use 'C' programming, but I understand that #pragma is used for CLOCK and CONFIG.

EDIT:
**broken link removed**
 
Last edited:
This is the output i get..I regulate the voltage with an LM7805, and my voltmeter says its 5.04..but PICkit2 says its only 4.98. Is that the problem?

I first connected the PICkit2 without powering my dev board, and then I got the same error, but underneath it said that the target didnt have power. Powered the board up, and stil have this problem. Added the crystal and the capacitors, still no change.


Initializing PICkit 2 version 0.0.3.63
Found PICkit 2 - Operating System Version 2.32.0
Target power detected ( 4.98V)
PIC18F4520 found (Rev 0x1)
PICkit 2 Ready

Programming Target (17/11/2010 7:51:32 AM)
PIC18F4520 found (Rev 0x1)
Erasing Target
Programming Program Memory (0x0 - 0x13F)
Verifying Program Memory (0x0 - 0x13F)
Programming Debug Executive (0x-7DC0 - 0x7FFF)
Verifying Debug Executive (0x7DC0 - 0x7FFF)
Programming Debug Vector
Verifying Debug Vector
Programming Configuration Memory
Verifying Configuration Memory
PK2Error0028: Unable to enter debug mode
PICkit 2 Ready
 
Last edited:
Aside from the config of the clock source issue, similar debugging experience described here, which version of the Pickit 2 also matters. The old version, black button, doesn't have pulldown resistors on PGC and PGD. The fix for was to add the pulldowns, for the debugger to operate properly. The newer red button Pickit 2 has those pulldowns.

Also the MCLRE is expecting a 10k pullup, unless the config has turned it off.
 
Please share the details of the solution so others may benefit from you experience.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…