how to programme using pickit 3

Discussion in 'Programmer's Corner' started by harami, Apr 8, 2012.

  1. harami

    Thread Starter Member

    Jun 20, 2011
    66
    0
    can anyone help me with programming a microcontroller using pickit 3. i am using MPLAB X. previously i have used MPLAB IDE v7.10 (old version). on this old version i was able to check if the microcoltroller is blank or not and it was easy to programme aswell. but im not being able to programme a microcontroller using this pickit 3. i had a brief look through the user guide aswell but no luck.. may be you can help me. how do i programme a PIC using pickit 3??
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    It is my opinion that MPLABX is far from finished. Unless you are running on LINUX. I would have used the latest MPLAB version instead
     
  3. panic mode

    Senior Member

    Oct 10, 2011
    1,321
    304
    Like everyone else, I am using MPLab 8.83. In general MPLab is not exactly the most intuitive product.


    Under menu
    Configure>Select Device
    pick correct MCU

    Under menu
    Programmer>Select Programmer>
    you can choose PicKit3

    Under menu
    Programmer>Settings
    are several tabs... Power tab let you choose if your circuit need to be powered by PicKit3 or not. If the circuit has own power, leave this unchecked. if circuit is not powered by any means, you need to set this option so PicKit will supply 5 or 3.3V for the CPU while it is programmed.
     
  4. nerdegutta

    Moderator

    Dec 15, 2009
    2,519
    786
    You can say that again!
     
  5. harami

    Thread Starter Member

    Jun 20, 2011
    66
    0
    I have downloaded MPLAB v8.84 but i cant connect my PICkit 3. it says the device is connected but it gives me an error afterward. (see attached pic)

    Also i am getting some an error when i build my project.. i have attached a screen-shot.. can u please have a look. i dont know how to correct those errors.
     
  6. nerdegutta

    Moderator

    Dec 15, 2009
    2,519
    786
    You must apply power to the chip.

    Either with a powersource that match the chip or:

    Programmer -> Settings -> Power

    Check the Power target circuit from PICKit3.

    For attachment #2, the compiler cannot find the file "peripheral/pconfig.h"
     
  7. chrisw1990

    Active Member

    Oct 22, 2011
    543
    41
    my two cents.. is mplab x a load of rubbish?? i thought id get in on it, nice gui, graphing of function calls.. but it wouldnt even find my #includes.. when it was being pointed in the right direction?!?! of a sample application from microchip!! what a load of poo. hope they sort it soon cos it promises to be a nice programmer, just need relearning from what i saw.. everythings in illogical places!:(
     
  8. harami

    Thread Starter Member

    Jun 20, 2011
    66
    0
    i have sorted the power error, however it says "Target Device ID (00000000) does not match expected Device ID (00001080)." i have selected correct device but also i keep getting this error.
     
  9. panic mode

    Senior Member

    Oct 10, 2011
    1,321
    304
    make sure you select correct voltage for the target (there is a voltage slider under Power tab) according to value listed in it's datasheet. if the pic is 3.3V, select 3.3V, if it is 5V device, select 5V.
     
  10. harami

    Thread Starter Member

    Jun 20, 2011
    66
    0
    i had a look on the datasheet and it says 2V to 5.5V. i have set the voltage at 5V and also tried 3.5V, 4V.. but no luck.. keep getting same error..
    then i tried MPLAB X.. everything is working correctly but when i run the project i got same error. and i dont see any power selecting option on mplab x. i have attached the screen-shot of the error. can it be because the PIC is burned?
     
  11. panic mode

    Senior Member

    Oct 10, 2011
    1,321
    304
    maybe,...

    but...

    did you read the datasheet? are you sure everything is connected correctly for ICSP?

    but how exactly are you programming it?
    is the chip in board or breadboard?
    what pins receive power?are all power pins powered? what voltage did you measure?
    is MCLR pulled high by resistor (10k for example)?
    is there anything else connected to PGC, PGD?
    what is connected to each of the 6 pins of PicKit3 programmer?
     
  12. nerdegutta

    Moderator

    Dec 15, 2009
    2,519
    786
    Has the uC been programmed earlier?
     
  13. harami

    Thread Starter Member

    Jun 20, 2011
    66
    0
    im programming it using pickit 3 if thats what you are asking. i insert the chip on a programmer kit to programme however i have also build the circuit on a breadboard so after i programme a chip i put it on a breadboard. i dont think its a connection fault. i think i burned the chip while programming therefore i have ordered a new chip. can you tell me how i can adjust a power for pickit 3 using mplab X. it is easy on mplab's other version but mplab x is totally different.
     
  14. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    It would help if you could draw up a schematic showing exactly how your project looks like
     
  15. harami

    Thread Starter Member

    Jun 20, 2011
    66
    0
    i bought a brand new PIC however i tried programming it and because i didnt select a correct power, i think i burned the PIC. can you tell how can i adjust the power for pickit 3 using MPLAB X. i looked on a user guide but it does not say how to adjust a power setting.
     
  16. chrisw1990

    Active Member

    Oct 22, 2011
    543
    41
    dont use mplab x!!!
     
  17. nerdegutta

    Moderator

    Dec 15, 2009
    2,519
    786
    I think you should post a schematic and your code. That way, we're on the same page.
     
  18. harami

    Thread Starter Member

    Jun 20, 2011
    66
    0
    Below is the code, with MPLAB X i used HI-TECH software, PICC-18. but when i import this project onto MPLAB v8.84, i cant use this complier. instead i use C18 compiler but it gives me an error saying it cant find a file called peripheral. this is because this file is from HI-TECH Software. is there anyway by which i can use this PICC-18 compiler with MPLAB v8.84 or i could avoid getting that error.
     
    Last edited: Apr 10, 2012
  19. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    In recent time Microchip has done big changes to its software structure. Like a new compiler that handle both PIC16 and PIC18F series. This compiler (XC8) is more less or the HI-Tech PIC18 and PIC16 compiler merged into 1 compiler. In MPLAB (not MPLABX), select toolbar and "Set Language Tool Locations" then do as shown in the picture
     
  20. nerdegutta

    Moderator

    Dec 15, 2009
    2,519
    786
    From you schema, you have a LED connected to PIN39, that is the Program Clock pin.

    Have you checked your documentation for the PICKit 3?

    You also need to put some resistors with the LEDs, but I don't think that has anything to do with your problem. Try to disconnect the LEDs on PIN39.

    This chip also have a PGM, have you tried to connect that to the PICKit3, and disconnect the LED on PIN38?
     
Loading...