1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Debug PIC18F26K20 with Pickit3

Discussion in 'Microcontrollers' started by Flyback, Jun 21, 2017.

  1. Flyback

    Flyback Well-Known Member

    Joined:
    Jan 5, 2007
    Messages:
    1,989
    Likes:
    34
    Hello,
    Our software works on some of our PCBs but not others.
    We program them with pickit3 and use ICSP.
    Can we just plug the Pickit3 into the board and debug it like that?

    When i try to debug I am getting "Connection failed" error in MPLAB X IDE. Do you know why?
    I have the 5 pin header in the pickit3 and its connected to the PCB.

    I actually programmed the board with this connector/wire assembly so i know the 5 lines are connected (MCLR,Vdd,Vss, PgD,PgC).

    In order to do debugging, do i have to program the PIC18F26K20 with the ".hlx" file instead of the normal ".hex" file?
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,141
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    Are the programming pins used solely for programming??? Have you set MPLAB to debug through pickit3 ?
     
    • Like Like x 1
  3. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,791
    Likes:
    134
    Location:
    morristown,tn
    You got set debug in the config word too and make sure lvp is turned off mplab x like to set that to on.
     
    • Like Like x 1
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,007
    Likes:
    316
    Location:
    Brisbane Australia
    ONLINE

    The debug bit in config is automatically set/cleared by the IDE depending on the build configuration. If you can program but not debug then something is wrong in hardware. Capacitor on Mclr? Some circuitry on PGD/PGC?

    Mike.
     
    • Like Like x 1
  6. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,791
    Likes:
    134
    Location:
    morristown,tn
    Well sounds good but maybe mplab X is acting like mine cause I've set it to use the pickit 3 and used the ccm to set pins and it's done funny things to the configure settings.
    I had to go back and change the configure on the chip the op is using and a pic 32 when i used the ccm
    I had about the same problem with this chip some times it would act like it wasn't working it had set to lvp and mclr turned off but that was using the ccm to set pins. witch don't work right some times I started reading the files ccm makes and change its mistakes or mine and it works fine after that.
     
    Last edited: Jun 21, 2017
    • Like Like x 1
  7. granddad

    granddad Active Member

    Joined:
    Jan 18, 2015
    Messages:
    749
    Likes:
    75
    Location:
    Worcestershire UK
    Perhaps ICSP Wires too long ? Also put a ferrite core / block on the USB cable , make sure PK3 pin 6 not connected.
     
    • Like Like x 1
  8. phalanx

    phalanx Member

    Joined:
    Oct 22, 2003
    Messages:
    405
    Likes:
    7
    Location:
    New Hampshire, USA
    Hi Flyback,

    I noticed you posted this exact question on the Sparkfun forums as the user "treez". You really need to follow up on your threads and provide the details people are asking for if you expect to get things squared away in a timely manner.

    -Bill
     
    • Like Like x 1

Share This Page