PK3CMD - No PICKit 3 Connected??

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I am trying to use the command PK3CMD. I have a PicKit3 attached to the USB, attached to the PicKit3 is a 18F45K20 demo board. If I use MPLAB then everything goes OK but no matter what I try with the PK3CMD command, I get:

No PICkit 3 Connected
Invalid Device Detected !!!


I have tried:

pk3cmd /P18F45K20 /GFHexCode.hex


and

pk3cmd /P18F45K20 /C

Each time I get the error message. Can anyone tell me what I am doing wrong?
 

t06afre

Joined May 11, 2009
5,934
If MPLAB is running, and connected to Pickit no other tools can use the Pickit unit. I hope your problem is that simple ;)
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
That was it!!!

I am now takling to the PicKit3.

But I still get this error

You must connect to a target device to use PICkit

And I think I see what is happening. The target board no longer being powered by the programmer. How do I turn i back on?
 

eng1ne

Joined Dec 4, 2009
97
I am not familiar with the CMD and so can't suggest code to turn it back on.

However, you could apply external supply to development board - just check the data sheet first! I recall an additional 10kR resistor being used...
 

BMorse

Joined Sep 26, 2009
2,675
The pickit3 should have a setting just like pickit 2 where you can set the device to either power the target or power off of the target device.....
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I am not familiar with the CMD and so can't suggest code to turn it back on.

However, you could apply external supply to development board - just check the data sheet first! I recall an additional 10kR resistor being used...

There is a command /V. It does seem to turn the PIC on through the PicKit 3.

But if I follow it up with a command to get memory I get the following.

pk3cmd /P18F45K20 /GFMyHex.hex

Connecting...
PICkit 3 detected
Connecting to PICkit 3...
Firmware Suite Version...... 01.25.10
Firmware type......................PIC18F
PICkit 3 Connected.
PK3Err0045:
You must connect to a target device to use PICkit

I sure wish this was documented somewhere. If it is I am not finding it.
 

BMorse

Joined Sep 26, 2009
2,675
There is a command /V. It does seem to turn the PIC on through the PicKit 3.

But if I follow it up with a command to get memory I get the following.

pk3cmd /P18F45K20 /GFMyHex.hex

Connecting...
PICkit 3 detected
Connecting to PICkit 3...
Firmware Suite Version...... 01.25.10
Firmware type......................PIC18F
PICkit 3 Connected.
PK3Err0045:
You must connect to a target device to use PICkit

I sure wish this was documented somewhere. If it is I am not finding it.
if you are trying to power the device off of the pickit 3, you must make sure all VDD and VSS pins are connected to get power from the Pickit3
 

BMorse

Joined Sep 26, 2009
2,675
here is what it says in the pickit 3 manual about device powering:

Note: The PICkit 3 programmer/debugger is powered through its USB
connection. The target board is powered from its own supply. Alternatively,
the PICkit 3 can power it only if the target consumes less than 30 mA.
The target board should be powered according to the requirements of the selected device (1.8V-5.0V) and the application.
so you do need to supply an external power source to your target device....
 

BMorse

Joined Sep 26, 2009
2,675
PK3Err0045:
You must connect to a target device to use PICkit

this is what they say to fix your error:


PK3Err0045: You must connect to a target device to use PICkit 3.
No power has been found.
1. Ensure VDD and GND are connected between the debugger and target.
2. Ensure that the target is powered.
3. Ensure that the target power is sufficient to be detected by the debugger (see
Chapter 10. “Hardware Specification”.)
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
The pickit3 should have a setting just like pickit 2 where you can set the device to either power the target or power off of the target device.....
It does. A /V. But if I first turn on the demo board usung MPLab. (I have a program loaded that lights an LED so I know it is on) then exit MPLab. and issue a command.

pk3cmd /P18F45K20 /V3.250, it turns off the board (LED goes out). If I go back into MPLab. All I nned to do is to change the settings so the Pic Lit powers the demo board and the light comes on.

if you are trying to power the device off of the pickit 3, you must make sure all VDD and VSS pins are connected to get power from the Pickit3
I have a demo board so I assume these are all connected or it would not work in MPLab correct?
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I see what is happening.

When I issue the /V command, the LED does come on briefly (board is powered) bu then it goes right back off again. It does not stay powered up. Why? Again works fine in MPLab.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I got it to work!

I need to combine commands.


For example

pk3cmd /P18F45K20 /V3.250 /GFMyHex.hex


How do I keep the board on through the PicKit3 using the PK3CMD?
 
Top