• AVR Freaks

Hot!ICD4 Debugger with PIC18F26K22 MCU

Author
Kabak
Starting Member
  • Total Posts : 81
  • Reward points : 0
  • Joined: 2014/07/30 03:47:55
  • Location: 0
  • Status: offline
2019/12/18 05:53:55 (permalink)
0

ICD4 Debugger with PIC18F26K22 MCU

I try to use ICD3 debugging with PIC18F26K22 without any problem.
 
But the same project is not loaded into PIC18F26K22 via ICD4
 
Connecting to MPLAB ICD 4...

Currently loaded versions:
Application version............01.06.28
Boot version...................01.00.00
FPGA version...................01.00.00
Script version.................00.03.33
Script build number............0540a22e50
ICD4 is supplying power to the target (5,00 volts).
Target device PIC18F26K22 found.
Device Revision Id  = 0x4

Calculating memory ranges for operation...

Erasing...

The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x53f
program memory: start address = 0xfd40, end address = 0xffff
configuration memory

Script GetVersionDE failed with status Type = runScript, Script name = GetVersionDE, Status = 0xa00
.
The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings.
 
 
I am using MPLABX 5.30.
 
There is no DEBUG bit in configuration bits CONFIG4L register.

 
I try to set manually in device_config.c
#pragma config DEBUG = ON
 
but it did not help with ICD4  ( project properties config to debug via ICD4 )
 
Whats i am doing wrong ?
 

 

#1

18 Replies Related Threads

    DevMod1
    Administrator
    • Total Posts : 485
    • Reward points : 0
    • Joined: 2009/02/10 09:34:30
    • Location: 0
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/18 09:20:59 (permalink)
    0
    do you have all the Vdd/Vss lines connected?
     
    Do you have a working oscillator??  You can't debug without a working osc.  (you can program but not debug)

    _____________________________

    Please read the forum posting guidelines. Do not double post, please help keep these forums professional and comments respectful.
    Please notify the moderators of problems/spam/trolls.
    #2
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/18 09:37:02 (permalink)
    0
    Yes.
     
    pins 8, 19 - Vss  ;  pin 20 - Vdd
     
    I am using internal oscillator. As i wrote upper, I am debugging project with ICD3 without problems.
    post edited by Kabak - 2019/12/18 09:46:48
    #3
    NKurzman
    A Guy on the Net
    • Total Posts : 18266
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/18 09:59:36 (permalink)
    0
    Inspect the ICD4 connector Pins.
    Are you using all the same cables?
    Run the ICD4 Self Test.
    #4
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/18 10:22:40 (permalink)
    0
    Yes i can program PIC18F26K22 in MPLABX IPE.  so i think no problem with cables. But i cant start debugging.
     
    Ok, i'll try to run Self Test tomorrow and post here results.  ( I can't do that today )
    post edited by Kabak - 2019/12/18 10:28:33
    #5
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/18 23:44:33 (permalink)
    0
    Test interface PGC clock line write succeeded.

    Test interface PGD data line write succeeded.

    Test interface PGC clock line read succeeded.

    Test interface PGD data line read succeeded.

    Test interface LVP control line test succeeded.

    Test interface MCLR level test succeeded.

    ICD 4 is functioning properly. If you are still having problems with your target circuit  please check the Target Board Considerations section of the online help.
    #6
    NKurzman
    A Guy on the Net
    • Total Posts : 18266
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/18 23:52:04 (permalink)
    0
    Check other threads. Some people are reporting issues with certain chips on MPlabX. They moved back to an drier version (5.20 I think) and that solved the issue.
    #7
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/19 02:12:25 (permalink)
    0
    I found this post,  copied  MPLAB X 4.10   icd4armfiles.jar  & icd4files.jar  into MPLABx 5.30 folder but it did not helps

    MPLABx found  icd4armfiles.jar  & icd4files.jar  uploaded files,  uplodedd older firmware into ICD4, but nothing changed
     

     
    Seems ICD4 debugger does not working with PIC18F26K22 :(

    I wrote to ICD4_update@microchip.com   They did not answer yet.
    #8
    Jerry Messina
    Super Member
    • Total Posts : 460
    • Reward points : 0
    • Joined: 2003/11/07 12:35:12
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/19 05:49:23 (permalink)
    0
    Device Support 2011-11-14
    **SIGH**
     
    It would be nice if they could at least include the correct documentation, but I know that's asking a lot.
    I noticed this with a number of the doc files... they're old versions.
    #9
    NorthGuy
    Super Member
    • Total Posts : 5917
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/19 06:34:32 (permalink)
    0
    I would suggest filing Microchip support ticket. ICD4 is new and may have some glitches.
    #10
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/19 07:47:42 (permalink)
    0
    Hello
     
    Thank you for advice.
     
    I did it. Here they left a message about requesting support.
    #11
    MShouk
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2012/05/19 00:52:26
    • Location: Chandler, Arizona
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/19 12:44:17 (permalink)
    0
    Hello Kabak,
     
    Can you attach a minimalist project that exhibits the problem? Or you can send to the ICD4_update email.
     
    We can start by finding out if it's a programming problem or a debugging problem.
     
    Start a successful debug session with the ICD3. Then stop the debug session, then attach the ICD4.
     
    Now instead of clicking on the "Debug Main Project" icon like you normally would (which would program and debug the device using the ICD4), just click on the small arrow on the icon and select "Launch Debugger Main Project". This should start debugging without programming (since everything should've been programmed by the ICD3 already from the previous debug session).
     
    Does this work?
    #12
    Mysil
    Super Member
    • Total Posts : 3642
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/19 17:59:14 (permalink)
    0
    Hi,
    It have earlier been reported that both PICkit 4 and also ICD 4
    have destroyed older PIC devices with too high Vpp voltage,
    when Programming with externally supplied Vpp on the /MCLR line.
    See this thread: https://www.microchip.com/forums/FindPost/1114960

    With Restriction on voltage range for Vpp, PIC18F26K22 might also be at risk.
    Because of this, I have Not before used my PICkit 4 for any 8 bit PIC devices

    Using MPLAB X v5.25 for PIC18F26K22,  
    ICD4 and PICkit 4 both show up as tested and supported for Programming and Debugging.

    I have a link to connect PICkit with Target board, made for some other purpose earlier,
    with a 180 Ohm series resistor in the _MCLR line, originally intended to monitor current in the line.

    So encourageded by this thread, I have used it to make some measurements.

    On the terminal from PICkit 4, there is a overshoot at least up to 10.15 V
    This is still within absolute MAX rating for the chip,
    but outside recommended Max.
    Other side of the 180 Ohm resistor the voltage is attenuated to about 8.77 V
    After about a millisecond for stabilisation, Vpp voltage converge at about 8.75 V

    With higher resolution capture of the rising edge,
    the overshoot reach 10.8 V
    This is still barely within absolute max rating for PIC18__K22 devices.

    After the Resistor, Voltage on /MCLR pin stay within recommended range at all time,
    and it Debug with no problem.
     
    Note however that the PIC18F26K22 is powered with external +5V.
        Mysil
     
    Edit: Apologies
    There is a Compensation issue with the oscilloscope probe used for the red trace in the capture shown in this message, so the overshoot voltage is Not caused by PICkit 4.
     
    Sorry,
        Mysil
    post edited by Mysil - 2019/12/20 09:38:50

    Attached Image(s)

    #13
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/20 00:58:45 (permalink)
    0
    Hi, MShouk
     
    I did that, and i got the same message :
     
    *****************************************************


    Connecting to MPLAB ICD 4...

    Currently loaded versions:
    Application version............01.06.28
    Boot version...................01.00.00
    FPGA version...................01.00.00
    Script version.................00.03.33
    Script build number............0540a22e50
    Target voltage detected
    Target device PIC18F26K22 found.
    Device Revision Id  = 0x4

    Resetting...
    Script GetVersionDE failed with status Type = runScript, Script name = GetVersionDE, Status = 0xa00
    .
    The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings.
    Failed to reset the device
     
    Seems problem not in programming.
    post edited by Kabak - 2019/12/20 01:01:25
    #14
    MShouk
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2012/05/19 00:52:26
    • Location: Chandler, Arizona
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/20 11:48:56 (permalink)
    0
    Does debugging fail on any code or is there a specific project that fails? For example, if you create a project from scratch in MPLABX (File -> New Project), does it fail as well with ICD4 and works with ICD3 (after modifying the appropriate configuration bits)?
     
    Unfortunately I am unable to induce a failure so I'm trying to match your configuration as much as I can.
     
    For example:
     
    - What voltage level are you running at?
    - Is the ICD4 supplying power to your board or is it self-powered?
    - What is your oscillator configuration? (you mentioned internal). Is the PLL on?
    - What silicon revision are you using?
    - Do you have BOR enabled?
    - Is the Watch dog timer enabled?
    - Is Power up timer enabled?
    - Have you tried setting the speed to Low (Project Properties -> ICD4 -> Program Options -> Program Speed)?
    - What circuitry is attached to PGC/PGD/MCLR ?
     
    Thank you.
    post edited by MShouk - 2019/12/20 11:55:10
    #15
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2019/12/22 08:54:27 (permalink)
    0
    1) 5.0V
    2) I tried both variants ( ICD4 supplied power, and i used external voltage power supply
    3) Internal with PLL on = 64Mhz
    4) What is silicon rev ?
     
    // CONFIG1H
    #pragma config FOSC = INTIO67   // Oscillator Selection bits (Internal oscillator block)
    #pragma config PLLCFG = ON      // 4X PLL Enable (Oscillator multiplied by 4)
    #pragma config PRICLKEN = ON    // Primary clock enable bit (Primary clock enabled)
    #pragma config FCMEN = OFF      // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor disabled)
    #pragma config IESO = OFF       // Internal/External Oscillator Switchover bit (Oscillator Switchover mode disabled)

    // CONFIG2L
    #pragma config PWRTEN = OFF     // Power-up Timer Enable bit (Power up timer disabled)
    #pragma config BOREN = SBORDIS  // Brown-out Reset Enable bits (Brown-out Reset enabled in hardware only (SBOREN is disabled))
    #pragma config BORV = 190       // Brown Out Reset Voltage bits (VBOR set to 1.90 V nominal)

    // CONFIG2H
    #pragma config WDTEN = OFF      // Watchdog Timer Enable bits (Watch dog timer is always disabled. SWDTEN has no effect.)
    #pragma config WDTPS = 32768    // Watchdog Timer Postscale Select bits (1:32768)

    // CONFIG3H
    #pragma config CCP2MX = PORTC1  // CCP2 MUX bit (CCP2 input/output is multiplexed with RC1)
    #pragma config PBADEN = OFF     // PORTB A/D Enable bit (PORTB<5:0> pins are configured as digital I/O on Reset)
    #pragma config CCP3MX = PORTB5  // P3A/CCP3 Mux bit (P3A/CCP3 input/output is multiplexed with RB5)
    #pragma config HFOFST = ON      // HFINTOSC Fast Start-up (HFINTOSC output and ready status are not delayed by the oscillator stable status)
    #pragma config T3CMX = PORTC0   // Timer3 Clock input mux bit (T3CKI is on RC0)
    #pragma config P2BMX = PORTB5   // ECCP2 B output mux bit (P2B is on RB5)
    #pragma config MCLRE = EXTMCLR  // MCLR Pin Enable bit (MCLR pin enabled, RE3 input pin disabled)

    // CONFIG4L
    #pragma config STVREN = ON      // Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset)
    #pragma config LVP = ON         // Single-Supply ICSP Enable bit (Single-Supply ICSP disabled)
    #pragma config XINST = OFF      // Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode disabled (Legacy mode))

    //#pragma config DEBUG = ON

    // CONFIG5L
    #pragma config CP0 = OFF        // Code Protection Block 0 (Block 0 (000800-003FFFh) not code-protected)
    #pragma config CP1 = OFF        // Code Protection Block 1 (Block 1 (004000-007FFFh) not code-protected)
    #pragma config CP2 = OFF        // Code Protection Block 2 (Block 2 (008000-00BFFFh) not code-protected)
    #pragma config CP3 = OFF        // Code Protection Block 3 (Block 3 (00C000-00FFFFh) not code-protected)

    // CONFIG5H
    #pragma config CPB = OFF        // Boot Block Code Protection bit (Boot block (000000-0007FFh) not code-protected)
    #pragma config CPD = OFF        // Data EEPROM Code Protection bit (Data EEPROM not code-protected)

    // CONFIG6L
    #pragma config WRT0 = OFF       // Write Protection Block 0 (Block 0 (000800-003FFFh) not write-protected)
    #pragma config WRT1 = OFF       // Write Protection Block 1 (Block 1 (004000-007FFFh) not write-protected)
    #pragma config WRT2 = OFF       // Write Protection Block 2 (Block 2 (008000-00BFFFh) not write-protected)
    #pragma config WRT3 = OFF       // Write Protection Block 3 (Block 3 (00C000-00FFFFh) not write-protected)

    // CONFIG6H
    #pragma config WRTC = OFF       // Configuration Register Write Protection bit (Configuration registers (300000-3000FFh) not write-protected)
    #pragma config WRTB = OFF       // Boot Block Write Protection bit (Boot Block (000000-0007FFh) not write-protected)
    #pragma config WRTD = OFF       // Data EEPROM Write Protection bit (Data EEPROM not write-protected)

    // CONFIG7L
    #pragma config EBTR0 = OFF      // Table Read Protection Block 0 (Block 0 (000800-003FFFh) not protected from table reads executed in other blocks)
    #pragma config EBTR1 = OFF      // Table Read Protection Block 1 (Block 1 (004000-007FFFh) not protected from table reads executed in other blocks)
    #pragma config EBTR2 = OFF      // Table Read Protection Block 2 (Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks)
    #pragma config EBTR3 = OFF      // Table Read Protection Block 3 (Block 3 (00C000-00FFFFh) not protected from table reads executed in other blocks)

    // CONFIG7H
    #pragma config EBTRB = OFF      // Boot Block Table Read Protection bit (Boot Block (000000-0007FFh) not protected from table reads executed in other blocks)


    8) Yes i tried LOW , NORMAL , HIGH speed  ( i tried Pull up , non , pulldown options also but did not played with resistors variables. )
    9) PGC connedted to ICDx debugging tools only
        PGD connedted to ICDx debugging tools only
      MCLR connected via10K resistor to +5.0v supply ( ICDx or external )  and to ICDx MCLR pin directly.
     
     
    post edited by Kabak - 2019/12/22 11:39:48
    #16
    MShouk
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2012/05/19 00:52:26
    • Location: Chandler, Arizona
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2020/01/23 16:30:08 (permalink)
    0
    Sorry for the delay.
    Unfortunately I'm still unable to recreate the problem.
    I have a few more suggestions to provide:
    1) Remove the 10K pullup.
    2) Is it code dependent? or would the problem happen with a main() { while(1); } program ?
    3) PLL: Does it work without the PLL?
    4) Hardware difference. Could you send the schematic or a snippet of it?
     
    Here is my session which shows successful debugging with the same configuration settings you provided:
    Connecting to MPLAB ICD 4...

    Currently loaded versions:
    Application version............01.06.28
    Boot version...................01.00.00
    FPGA version...................01.00.00
    Script version.................00.03.33
    Script build number............0540a22e50
    Target voltage detected
    Target device PIC18F26K22 found.
    Device Revision Id  = 0x4

    Calculating memory ranges for operation...

    Erasing...

    The following memory area(s) will be programmed:
    program memory: start address = 0x0, end address = 0x3f
    program memory: start address = 0xfd40, end address = 0xffff
    configuration memory

    Programming/Verify complete

    Running


    #17
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2020/01/24 07:49:23 (permalink)
    0
    Hi 
     
    1) I removed 10k pullup resistor ( it does not helped )
    2) I did not experiment with the code
    3) I switched it OFF ( it does not helped )
    4) Pins that used for programming PIC18F26K22 does not connect to anything else. 
     
    Other words, If ICD3 works fine with that device then ICD4 should if only developers of ICD4 or firmware exclude PIC18F26K22 from supported ICD4 device list. ( they wrote , that PIC18F26K22 was not tested with ICD4. So no GREEN mark in that list about PIC18F26K22 supports for debugging with ICD4. It marked YELLOW ) I got the same error : 
    Connecting to MPLAB ICD 4...

    Currently loaded versions:
    Application version............01.06.28
    Boot version...................01.00.00
    FPGA version...................01.00.00
    Script version.................00.03.33
    Script build number............0540a22e50
    Target voltage detected
    Target device PIC18F26K22 found.
    Device Revision Id = 0x4

    Calculating memory ranges for operation...

    Erasing...

    The following memory area(s) will be programmed:
    program memory: start address = 0x0, end address = 0xfff
    program memory: start address = 0xfd40, end address = 0xffff
    configuration memory

    Script GetVersionDE failed with status Type = runScript, Script name = GetVersionDE, Status = 0xa00
    .
    The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings.

     
     
    Yoursprogram memory: start address = 0x0, end address = 0x3f
    program memory: start address = 0xfd40, end address = 0xffff Mineprogram memory: start address = 0x0, end address = 0xfff
    program memory: start address = 0xfd40, end address = 0xffff Maybe i'll try other code later.
    post edited by Kabak - 2020/01/24 08:44:42
    #18
    Kabak
    Starting Member
    • Total Posts : 81
    • Reward points : 0
    • Joined: 2014/07/30 03:47:55
    • Location: 0
    • Status: offline
    Re: ICD4 Debugger with PIC18F26K22 MCU 2020/01/28 11:00:25 (permalink)
    0
    MShouk
     
    What it yours ICD4 rev ?   Mine : 10-10079-REV4
    #19
    Jump to:
    © 2020 APG vNext Commercial Version 4.5