PK3CMD - No PICKit 3 Connected??

Discussion in 'Embedded Systems and Microcontrollers' started by spinnaker, Dec 17, 2009.

  1. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    989
    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?
     
  2. t06afre

    AAC Fanatic!

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

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    989
    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?
     
  4. eng1ne

    Member

    Dec 4, 2009
    97
    3
    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...
     
  5. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    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.....
     
  6. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    989

    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.
     
  7. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    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
     
  8. BMorse

    Senior Member

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

    so you do need to supply an external power source to your target device....
     
  9. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234

    this is what they say to fix your error:


     
  10. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    989
    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.

    I have a demo board so I assume these are all connected or it would not work in MPLab correct?
     
  11. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    989
    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.
     
  12. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    989
    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?
     
Loading...