Introduction: How to Make a PIC Programmer - PicKit 2 'clone'

Hi! This is a short Instructable on making a PIC programmer which acts as a PicKit 2. I made this because it is way cheaper than buying an original PicKit and because Microchip, the manufacturers of PIC microcontrollers and the PicKit programmer, provides schematics and software, making it really easy for us to design our own programmers, definitely an advantage of using PICs.


Tools Needed:

  • Soldering Iron and solder
  • Wire Snips
  • Needle Nose Pliers
  • PCB etching tools and materials - Can be replaced with a breadboard but will take up more space
  • Already working programmer (This is the downside, maybe you can borrow one)
  • PC (for programming the PIC that goes into the PicKit)

Materials Needed:

  • 2 x 100nF ceramic capacitor
  • 2 x 15pF ceramic capacitor
  • 2 x 47uF 16v electrolytic capacitor
  • 1 x 10uF 16v electrolytic capacitor
  • 2 x 1N4148 diode
  • 1 x PIC18F2550
  • 1 x 28 pin thin IC socket (for the PIC18F2550)
  • 1 x 680uH inductor, resistor-like package
  • 2 x 3mm LED (one green and one red)
  • 3 x BC548 transistor
  • 1 x BC557 transistor
  • 1 x 20MHz oscilator crystal
  • 3 x 33 ohm resistor
  • 1 x 100 ohm resistor
  • 2 x 330 ohm resistor
  • 1 x 1k resistor
  • 1 x 2k7 resistor
  • 2 x 4k7 resistor
  • 3 x 10k resistor
  • 1 x 100k resistor
  • 1 x 2-pin tactile switch (button)
  • 1 x pin strip (only 6 needed)

Step 1: Schematics and PCB Design

For the schematics, I based my design on the one provided by Felixls in his page:

http://sergiols.blogspot.com.ar/2009/02/pickit-2-c...

He also provided a PCB design, but I found that the traces were too thin to make at home, so I redesigned the PCB on Proteus.

Here are the files of the design and a pdf to print for making the PCB.

Step 2: Making the Board

If you want to learn how to make a PCB at home there are plenty of Instructables online where you can learn.

Once you have finished making the board you will need to solder the components, you can use these pictures to help.

Component list:

C1 100nf

C2 47uf 25v

C3 100nf

C4 47uf 25v

C5 10uf 50v

C8 15pf

C9 15pf

D1 1N4148

D2 1N4148

IC1 PIC18F2550

L1 680uH

LED RED LED 3MM

LED GREEN LED 3MM

Q1 BC548

Q2 20MHZ

Q3 BC548

Q4 BC548

Q5 BC557

R1 33

R2 33

R3 33

R4 4k7

R5 330

R6 1k

R7 330

R8 100k

R9 2k7

R10 4k7

R11 10k

R12 100

R13 10k

R14 10k

BTN tactile switch

SV3 6 pins

X3 USB B female

Step 3: Programming the Programmer

To program the PIC18F2550 to use in the programmer you will need a functioning PicKit. Once you get one or borrow one, you will need to install the PicKit 2 software: PicKit 2 v2.61

First open PicKit 2 and plug your functioning programmer. If it doesn't say 'PicKit connected' in the message window, try clicking ‘Tools > Check communication’.

Then connect the PIC18F2550 to your functioning programmer using a breadboard and making the appropiate connections, like the image above shows.

If it isn't detecting the PIC, showing 'PIC Device Found', then try clicking ‘Tools > Check communication’ a couple times. If it still doesn't detect the PIC, check the connections.

To upload the program to the PIC go to ‘File > Import’, then ‘C:\Program Files (x86)\Microchip\PICkit 2 v2\PK2V023200.hex’ and click 'Open'

Wait until it says 'Hex file successfully imported' and click ‘Write’ , the wait for it to say 'Programming successful'

Step 4: Using the PicKit

First plug in our programmer and open PicKit 2. Wait for PicKit to detect the programmer, and if it doesn't, click 'Tools > Check Communication'.

Connect the PIC we want to program to our programmer. If you don't know how you can search online for the pin distribution of the PIC and find the corresponding MCLR, VDD, VSS, PGD and PGC pins to connect to the programmer.

Wait for PicKit to detect the PIC showing 'PIC Device Found', if it doesn't then try clicking ‘Tools > Check communication’ a couple times. If it still doesn't detect the PIC, check the connections.

Open MPLAB, MPLAB X, or whichever IDE you are using and compile the program.

After compiling, go back to PicKit 2 and go to 'File > Import Hex'. With MPLAB X you can find the hex file of your project in 'Project_Directory > dist > default > production > Project_Name.production.hex'

Click 'Write' and wait for it to show 'Programming Successful'

If you wish to modify your program you don't need to import the hex file again, you should just compile it an click 'Write' in the PicKit software. Among the messages it displays it should read 'Reloading hex file' .

That's it !

Happy programming

Comments

author
CrtSuznik (author)2017-08-12

Made it a while back and now finally wanted to use it. It recognises that its a Pickit2, but reports an external voltage connected to it when I try to calibrate it. Does this mean I have a short somewhere or that the components I used dont quite match the requirements? (I used generic npn and pnp transistors, obviously checked the b,e,c pins)
Any ideas what I should do now?

author
Mati_DIY (author)CrtSuznik2017-08-18

I am not sure what you could do, it could be that there is a short on the board like you said, causing the pin to be connected to some other voltage on the board. If you cant solve the problem perhaps you could ask on the Microchip forum

author
CrtSuznik (author)2017-04-24

Do I HAVE TO use the BC548 and the CB557 or can I use a generic NPN and PNP?

author
Mati_DIY (author)CrtSuznik2017-04-24

I would think it is very likely that any generic transistor would work as long as it has reasonable electrical characteristics like max current or voltage drop. I am not 100% sure since I didn't design the circuit but you can try and tell us.

author
CrtSuznik (author)Mati_DIY2017-05-27

Just made it. Generic PNP and NPN transistors work. Also I used 12pF transistors instead of the 15pF and 2x330uH inductors in series instead of the 680uH one and that seems to be fine too.

author
Mati_DIY (author)CrtSuznik2017-05-27

Great! I'm glad it worked after all.

author
Amit0710 (author)2017-03-10

Doesn't have pickit2 for programming Pic18f2550

Can we use Arduino uno as programmer instead of pic kit 2☺

author
Mati_DIY (author)Amit07102017-03-12

Hi, I have never tried it but I think it is possible. With a quick search I found this tutorial that might help you: https://sites.google.com/site/thehighspark/arduino...

Maybe you can try it and tell us how it went

author
indika154 (author)2017-03-07

really nice and informative will make one

author
agis68 (author)2017-03-02

hi, very good job...I work with arduino but not at all with pics. If i want the same for the 16f84a pic what changes should do in the schematic...(recently start work with this specific pic)

author
Mati_DIY (author)agis682017-03-05

Hi, this programmer can program your PIC, but you need to make the programmer with the 18f2550 since the code is made for this pic

author
marsekal (author)2017-03-01

good job

author
Mati_DIY (author)marsekal2017-03-01

Thank you :)

About This Instructable

5,792views

109favorites

License:

Bio: I'm a 17 years old electronics engineering student
More by Mati_DIY:Simple Line Follower Robot With No Programming - Analog Line FollowerHow to make a PIC programmer - PicKit 2 'clone'Line Follower Robot With Arduino - Very Fast and Very Simple
Add instructable to: