how to programme using pickit 3

Thread Starter

harami

Joined Jun 20, 2011
66
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??
 

t06afre

Joined May 11, 2009
5,934
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
 

panic mode

Joined Oct 10, 2011
2,749
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.
 

Thread Starter

harami

Joined Jun 20, 2011
66
Under menu
Programmer>Select Programmer>
you can choose PicKit3
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.
 

Attachments

nerdegutta

Joined Dec 15, 2009
2,684
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"
 

chrisw1990

Joined Oct 22, 2011
551
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!:(
 

Thread Starter

harami

Joined Jun 20, 2011
66
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"
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.
 

panic mode

Joined Oct 10, 2011
2,749
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.
 

Thread Starter

harami

Joined Jun 20, 2011
66
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.
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?
 

Attachments

panic mode

Joined Oct 10, 2011
2,749
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?
 

Thread Starter

harami

Joined Jun 20, 2011
66
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?
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.
 

Thread Starter

harami

Joined Jun 20, 2011
66
Has the uC been programmed earlier?
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.
 

chrisw1990

Joined Oct 22, 2011
551
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.
dont use mplab x!!!
 

Thread Starter

harami

Joined Jun 20, 2011
66
I think you should post a schematic and your code. That way, we're on the same page.
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.
 

Attachments

Last edited:

t06afre

Joined May 11, 2009
5,934
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
 

Attachments

nerdegutta

Joined Dec 15, 2009
2,684
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?
 
Top