PK3Err0040: The target device is not ready for debugging


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2014
    Posts
    1

    Question PK3Err0040: The target device is not ready for debugging

    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!

  2. #2
    Join Date
    Sep 2009
    Posts
    737


    Did you find this post helpful? Yes | No

    Default Re: PK3Err0040: The target device is not ready for debugging

    #pragma looks to me as C, this is basic forum...
    MCLRE must be ebnabled, PWRT disabled, code protect disabled.

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: PK3Err0040: The target device is not ready for debugging

    Thats what I thought, I also don't know what "mcc18 v3.31" is? Maybe Microchip "C" forum is the place for the correct answer?
    Dave Purola,
    N8NTA
    EN82fn

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: PK3Err0040: The target device is not ready for debugging

    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Target Device does not match selected device
    By queenidog in forum FAQ - Frequently Asked Questions
    Replies: 3
    Last Post: - 25th June 2011, 01:24
  2. ICDWarn0020: Invalid target device id
    By pravec065 in forum General
    Replies: 3
    Last Post: - 4th August 2008, 14:43
  3. Target device does not match
    By krohtech in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd February 2008, 05:20
  4. PIC18F4620 not Target Device
    By kiwipiper in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th October 2007, 20:42
  5. Target device <> Selected Device????
    By deepgfishing in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 20th June 2007, 22:18

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts