HELP- Problems loading a program with MPLAB ICD 3.

Author
DavidCorleone83
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2009/06/17 11:42:24
  • Location: 0
  • Status: offline
2009/06/17 13:01:00 (permalink)
0

HELP- Problems loading a program with MPLAB ICD 3.

Hello everybody and thanks.
I just bought the MPLAB ICD3 for debugging programs in a PIC18f452.My first program is very simple, not much mystery:

#include "p18f452.h"
#pragma config WDT = OFF
 
void main (void)
{
  /* Make all bits on the Port B (LEDs) output bits.
   * If bit is cleared, then the bit is an output bit.
   */
  TRISB = 0;
 
  /* Reset the LEDs */
  PORTB = 0;
 
  /* Light the LEDs */
  PORTB = 0x5A;
 
  while (1)
    ;
}

Build all and perfect.  I want to load the program to the PIC and I conect MPLAB ICD 3 and I get a message like:
-VOLTAGE CAUTION-

Check that the device selected in MPLAB IDE (PIC18F452) is the same one that is phisically attached to the debug tool. Selecting a 5v device when a 3.3V device is connected can resul in damage to the device when debugger checks the device ID


And
ICD3Err0040: The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding.
 
I have reviewed the circuit thousands of times. Pins circuit debug MPLAB ICD 3 are well connected, the 5 (6 is LVP),  target VDD=5V direct to the PIC, VSS = 0, and 20MHz clock / MCLR is connected to VDD to 4K7 ohms. The configuration bit is set in code.

I'm desperate because I do not understand is happeningpink. Thanks!!!
Sorry for my english














#1

9 Replies Related Threads

    NY
    Super Member
    • Total Posts : 348
    • Reward points : 0
    • Status: offline
    RE: HELP- Problems loading a program with MPLAB ICD 3. 2009/06/19 09:20:50 (permalink)
    0
    Hi,

    The Voltage Caution dialog is nothing to worry about. It's just a warning message to serve as caution for the user. You can choose not to display it again by checking the box "Do not show again" on the dialog. Otherwise, in the Warnings tab of the ICD3 Settings dialog, you can uncheck this warning, so that it won't be displayed again.

    Regarding the error message "ICD3Err0040: The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding":
    1. From the code you posted it can be seen that you have only disabled the Watchdog Timer, therefore rest of the configuration bits will be in their default values, since you have not explicitly set them in code. You could try selecting the correct oscillator in the configuration bits and also disable Low Voltage Program. That is,

    #pragma config OSC = HS // when you have a 20MHz crystal oscillator connected externally
    #pragma config LVP = OFF

    2. You could also check the various points given in the section Debug Failure Actions (Troubleshooting>Error Messages> Debug Failure Actions) in the MPLAB ICD3 help file to ensure you have not missed anything


    NY
    #2
    DavidCorleone83
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2009/06/17 11:42:24
    • Location: 0
    • Status: offline
    RE: HELP- Problems loading a program with MPLAB ICD 3. 2009/07/06 13:12:10 (permalink)
    0
    Thank you very much, finally everything right. Failure was not set bits in the program.
    Thanks again
    #3
    Maurya
    Starting Member
    • Total Posts : 63
    • Reward points : 0
    • Joined: 2016/06/02 21:23:08
    • Location: 0
    • Status: offline
    Re: RE: HELP- Problems loading a program with MPLAB ICD 3. 2016/06/15 05:43:42 (permalink)
    0
    some of the project does not allow debug mode,i get this ICD3Err0040: The target device is not ready for debugging.
    I have tried above solutions still it does not work.I am using pic24fj128ga310 with explorer 16 board and MPLAB 8.92v
    #4
    NKurzman
    A Guy on the Net
    • Total Posts : 14407
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: RE: HELP- Problems loading a program with MPLAB ICD 3. 2016/06/15 06:02:12 (permalink)
    +1 (1)
    You should have started a new thread.
    Which set of programing pins are you using? Which are set in you config.
    #5
    Maurya
    Starting Member
    • Total Posts : 63
    • Reward points : 0
    • Joined: 2016/06/02 21:23:08
    • Location: 0
    • Status: offline
    Re: RE: HELP- Problems loading a program with MPLAB ICD 3. 2016/06/15 21:41:01 (permalink)
    +1 (1)
    sorry I m new to forum, was not getting option to start new thread.
    About configuration bit I am not setting any....i think that means every thing is at its default value
    #6
    NKurzman
    A Guy on the Net
    • Total Posts : 14407
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: RE: HELP- Problems loading a program with MPLAB ICD 3. 2016/06/15 21:47:12 (permalink)
    +1 (1)
    You need to set the pins your icd3 is connected to to be the debugging pins.
    #7
    Maurya
    Starting Member
    • Total Posts : 63
    • Reward points : 0
    • Joined: 2016/06/02 21:23:08
    • Location: 0
    • Status: offline
    Re: RE: HELP- Problems loading a program with MPLAB ICD 3. 2016/06/15 23:06:22 (permalink)
    0
    which pin to be set and how?
    #8
    DarioG
    Scheisse Menschen
    • Total Posts : 52256
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: hi there
    • Status: offline
    Re: RE: HELP- Problems loading a program with MPLAB ICD 3. 2016/06/16 01:45:59 (permalink)
    0
    It's a CONFIG setting that you place in one of your file (along the others) and is similar to
        _CONFIG1( JTAGEN_OFF & GCP_OFF & GWRP_OFF & COE_OFF & ICS_PGx1 & FWDTEN_OFF /*& FWPSA_PR32 */ & WDTPS_PS512 /*& BORV_27*/)


    Note the ICS_PGx1

    Dario Greggio
    --
    Wouldn't it be wonderful, if you lost one son for every promise you don't keep?
    #9
    Maurya
    Starting Member
    • Total Posts : 63
    • Reward points : 0
    • Joined: 2016/06/02 21:23:08
    • Location: 0
    • Status: offline
    Re: RE: HELP- Problems loading a program with MPLAB ICD 3. 2016/06/22 04:24:37 (permalink)
    +1 (1)
    I tried above but did not work :(
    I am using MPLAB 8.92, any other possible solution to get debugger enabled?
    #10
    Jump to:
    © 2017 APG vNext Commercial Version 4.5