connection issues with pickit 2 and MPLAB X IDE

Discussion in 'Embedded Systems and Microcontrollers' started by hunterage2000, Apr 11, 2014.

  1. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
    I am new to pic and having trouble getting pickit 2 programmer v2.4 to recognize a link to a p16f690 through a pickit 2 and ICSP. I have wired VPP, VDD, VSS, PGD and PGC from pickit 2 to the pic on a breadboard (attachment 1).

    If I try to put the program straight to the chip via "make and program device" I get this error msg (attachment 2).

    If I "debug program" I get this error msg (attachment 3).

    Can anyone help?
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Can you create a zip of your project and post it here
     
  3. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
    its not a project just config bits and the initializing of portb like this.

    Code ( (Unknown Language)):
    1.  
    2. #include "p16F690.inc"
    3.  
    4.  
    5.  __CONFIG _FOSC_EC & _WDTE_ON & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_ON & _IESO_ON & _FCMEN_ON
    6.  
    7. status equ 03
    8. portb equ 06
    9. trisb equ 86
    10.  
    11. RES_VECT  CODE    0x0000            
    12.                  
    13. GOTO START
    14.  
    15. MAIN_PROG CODE                  
    16.  
    17. START
    18. BCF STATUS,RP0 ;Bank 0
    19. BCF STATUS,RP1 ;
    20. CLRF PORTB ;Init PORTB
    21. BSF STATUS,RP0 ;Bank 1
    22. MOVLW 0xFF ;Set RB<7:4> as inputs
    23. MOVWF TRISB ;
    24. BCF STATUS,RP0 ;Bank 0
    25.     GOTO $                          ; loop forever
    26.  
    27.     END
    28.  
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Always use a project then programming in MPLAB ;)
     
  5. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
    At the minute I'm not sure why pickit 2 programmer is not acknowledging the ICSP connection to the pic. Any suggestions?
     
  6. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    yes it is somethings with your settings I think. I have used Pickit and your chip many times with MPLAB(X). Is it any reason like using Linux/mac as OS that keep you from using MPLAB and not MPLABX. The Pickit2 can debug your chip. But not without a hardware part named debug header. And this you do not have. I think your problems are related to problems around this
     
  7. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,570
    2,381
    If you did not build a project, have you selected the proper PIC in configure and if not supplying 5v from the board, then select supply power from Pickit2.
    Also when programming, do you use the Program>Program device from the pull down menu?
    OK I see you are using MPLAB X.
    Max.
     
  8. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    The PICkit 2 has a nice feature in that you can use the PICkit to troubleshoot the connections.

    Open the standalone app and click Troubleshoot under Tools and follow along.

    My personal favorite is to swap the clock & data lines. I'm about 50-50 in getting it correct the first time (even on a PCB once).
     
  9. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
  10. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Here is a MPLABX project running from folder c:\test\test.x I tested it with a PICKIT2 and a 16f690 chip. And at least on my computet it works. The code can be compiled and the chip programmed. A thing to notice. You can not have the PICKIT2 selected as tool in MPLAB and run the PICKIT2 programmer app at the same time. Before you in the menue select Debug->Disconnect From Debug Tool. Then you can start the PICKIT2 app and use it for programming.
    See if this help you in any way
     
  11. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    I've only seen the PICkit 2 Programmer say that when I have not plugged the programmer itself in yet.

    It's not a PIC problem, it is a PICkit problem. Unless your USB port or cable are broken then I am sorry to say your PICkit has gone off and joined the choir invisible.

    [​IMG]
     
  12. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
    ok t06afre I have used your test folder and it has programmed the chip with portb,6 set as 1 so nice one for that. What I dont understand is we used the same code and config setup but when I run mine it says "the programmer could not be started".

    Can you go through what configurations you made?
     
  13. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
    actually its working now, thanks everyone for helping.
     
  14. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Do you know what you did to make it work. Anyway remember that only one program my use the PICKIT at the same time
     
Loading...