Introduction: 5 Transistor PIC Programmer *Schematic Added to Step 9!

Picture of 5 Transistor PIC Programmer *Schematic Added to Step 9!

Make your own PIC programmer for your computer's parallel port. This is a variation of David Tait's classic design. It is very reliable and there is good programming software available for free. I like IC-Prog and PICpgm programmer. Best of all, it uses just two voltage regulator and 5 transistors!

*** I added a pic of the final result, and pics of my new mini-programmer with a clear top. Click the smaller images below!

** This is a new variation and it didn't work 100% correctly on the first attempt. I guess I got ahead of myself.. I have built several variations, and I thought I was on top of things. :) There are a couple of changes, but everything worked out in the end. I had to add an additional npn transistor and change a couple of resistor values. These changes are already reflected in this list, but are not updated in all the pics. See step 7 for pics of the software I use and how to set up the programmer.

You need:
A male DB25 socket
4x NPN transistors, such as the 2n3904
1x PNP transistor, such as the 2n3906
1x 7805 voltage regulator
1x LM317 voltage regulator (and appropriate resistors to make 12.5V)
1x 10k SIP resistor network
4x 10k resistors
1x 22k resistor* update for step 3
1x 5k resistor
1x 1k resistor* update for step 3
1x machined-pin chip socket
soldering iron, protoboard, wraping wire, wrapping tool, glue gun.

Step 1: Index Card

Picture of Index Card

If you have copper tape, lay a strip down as a ground plane. If not, put a row of staples into the paper along one edge and solder them together.

Then bend the legs of the SIP resistor network, and glue as shown.

Step 2: ICSP Port

Picture of ICSP Port

Make an ICSP port with part of a chip socket, like this. Carefully bend the pins at a right angle.

Now glue port down.

Now is also a good time to glue your transistors on. You can also solder the emitter of your npn transistors to the ground plane, now. I have labelled each transistors purpose here.

The three npn transistors will be wired as inverters. They will essentially "take power away" from their respective pullup resistor when a current is placed onto their base pin.

The PNP transistor (upside down) will control the programming voltage. It is also going to invert it's signal.

**EDIT: I just realized an omission in this design. There should be one additional npn transistor that is used to drive the PNP transistor. This will buffer your computer port from the voltages at the pnp's base. My bad. This will also uninvert the signal. See step 8.

Step 3: Base Resistors

Picture of Base Resistors

I used 10k base resistors. Solder where circled. I messed up the pnp transistor in this pic. Disregard the whited out area.

**EDIT: the base resistor for the "data in" tranny should be 22k. Also, data out tranny should not be pulled up with the 10k resistor network. Instead, pull it up with a 1k resistor. I just realized that these two resistors will form a voltage divider, and if each is 10k data high will be 2.5V... no good. (Alternatively, you could just leave things the way they are, but connect Data Out transistor's collector to all remaining 5 10k pullups. This makes the divider 2/10, which should still suffice. On my particular circuit, that's what I did, and it registers 4.24V as high, which should be enough.)

Picture 2:
The pnp transistor gets two base resistors wired as a divider. Solder the 10k resistor between emitter and base. Solder one end of your 5k (actually I used 3.3k cuz I had it lying around) to the base. You can connect collector to Vpp pin, now, since it is close.

Eventually, you will be connecting the emitter to 12.5V source. The 10k resistor keeps the base high - thus programming voltage off. When pin 5 of your parallel port goes low, it pulls the base low, via the 5k resistor.

The schemmy I used also showed a 10k resistor between collector and ground. I'm not sure what it's for. I think it is to ensure that the PIC's MCLR pin does not float. But that would be silly, since MCLR is usually going to be connected to an external pullup, anyway. In addition, MCLR pin is an active sink of a few microamps. It doesn't float. At any rate, I have recklessly omitted this resistor. Bonus points for anyone who can tell me why this is bad idea.

Step 4: DB25 Port

Picture of DB25 Port

DB25 is the designation of a parallel port. As far as I know, they are synonymous. You want the male part, as your comp has a female plug.

You may glue it on the edge of the card, for now.

No wait! You glued it too soon! First make pins 18-25 common, as they will be common ground pins. Oh.. it's ok, cuz the card can bend.

Actually, a better way to do this part is to bend each pin over onto it's neighbor, then solder them down. I am just trying to illustrate how the connections should go.

Step 5: DB 25 Connections

Picture of DB 25 Connections

Ok. Pin 2 of the DB25 port is the data out pin. Connect it to the "data out" base resistor. The final result: when this pin goes high, the pic's RB7/data pin will receive a low signal. (what's the point of inverting things? A side effect of inverting a signal is that you buffer it, as well. Buffering the signals here, using an external power source, is the whole point of the npn transistors.)

Pin 3 is the clock out pin. Connect it to the "clock out" base resistor.

Picture 2: pin 10 is the data IN pin. Connect this to the pullup resistor of the "data in" transistor, as seen in blue circles.

Pin 5 is the programming voltage pin, or Vpp pin. See step 8. You will need to add a fourth npn transistor, and connect this line to it's base resistor. The transistor's collector will connect to the 5k base resistor of the pnp transistor. The emitter will connect to ground plane.

Step 6: ICSP Port Side

Picture of ICSP Port Side

In my setup, I chose to make clock bottom, data top, and ground, Vdd, and Vpp inbetween. This is completely arbitrary.

The ICSP data pin will connect to BOTH the pullup resistor for the "data out" tranny AND to the base resistor of the "data in" tranny. BLUE circles **EDIT: pull up Data Out with either a 1k resistor, or with all 5 remaining 10k pullups on the resistor network. Using just one 10k resistor will cause data high signal to be divided down to 2.5V.. That won't register as high, as CMOS parts running at 5V need about 3.5V to register high.

The Vpp pin will connect to the PNP transistor's collector.

The Vdd pin will connect with your network resistor pin 1. ORANGE circles If you want an on/off switch on the programmer, insert it between these points.

The ground pin will connect somewhere on the ground strip.

The clock pin will connect with the pullup resistor of the "clock out" transistor. YELLOW circles

Step 7: New Pictures... Finished and Tested.

Picture of New Pictures... Finished and Tested.

Here's the finished programmer. You can't tell in the pic, but I cut a piece of clipboard to the right size and used Elmer's to glue the card to the board.

I pulled out my LCD for a quick test. It reads, writes, erases. What more can you ask? Check the pics for a screenshot of how to set up ICProg or PICPgm programming softwares. Also check step 8 for detail of a couple of corrective measures that are featured here.

I added two lm317's for 5V and programming voltage.

Step 8: Correction!!!

Picture of Correction!!!

Here's the correction. Oops... update. See next pic.

You should have another npn transistor to buffer the port from the potentially hazardous voltages at the pnp's base. This is depicted in the top left. Collector does not attach to a pullup resistor. The pnp base is already pulled up to Vpp. Emitter is grounded. The collector connects to the 5k base resistor of the pnp transistor. I also show the 10k pull down resistor that I omitted earlier. I still don't know what it's for, though. :)

Because you are buffering with the use of inverters, when you use a TAIT compatible programming softare, you will need to go into the programmer settings and invert the clock, data out, and data in. Because you double invert the Vpp line, you will leave it alone.

FYI, the original TAIT uses DB25 pin 4 to control Vdd. I don't like this, because then you can't run your pic from the programmer's power source. I have added a manual switch in some of my other progammers, but it never gets used. Why would you go behind your computer to turn your circuit on/off? I just add a switch to my breadboard/circuit to control Vdd. You have to disconnect power or the icsp cable when not in use, though, so as to avoid shorting power and ground.

Step 9: Schemmy, Using a 9V Battery! and a Gratuitous Kitty Photo :)

Picture of Schemmy, Using a 9V Battery! and a Gratuitous Kitty Photo :)

Pic 1: Just add an on/off switch to the battery, and this programmer is good to go. If your circuit draws more power than the wimpy battery can handle, add a different power supply between 9 and 12.5V (check if with a multimeter! 12V unregulated usually means 18-20V under low draw - and will kill yor pic). If your nearest wall wart gives more than 12.5V, then you will have to add another voltage regulator.

OR you could leave the 9V battery connected to the pnp transistor, but disconnect it from the 7805. Then insert your external power source, less than 35V, to the 7805. Well, now that you understand how the programmer works (ya do, right?), you can modify it any way you like from here. Adding some indicator LEDs might be nice?

Pic 2: Smurfy. Shhhh, she's sleeping.


ali7509 (author)2011-10-27

i have made the hardware as shown in the schematic in last step but i am unable to get the desired results ..
is the schematic in the last step is fine??

klee27x (author)ali75092011-11-02

Yeah, the schematic is verified by multiple people.

One thing about the selected resistor values is they're designed for low current draw. But this isn't ideal for ICSP with loaded lines. If you are trying to program a PIC out of circuit, recheck your wiring. If you're doing ICSP, you might want to decrease all the resistor values proportionally. Say 1/10 the values shown, just make sure your transistors can handle the current.

matstermind (author)2011-02-17

is the schematic updated so it works?

superbird (author)2010-02-02

The Project is great but the cat is the best!!

sventeeuwen (author)2009-06-12

smurfy is so cute!!!

klee27x (author)sventeeuwen2009-06-26

... Hehe, yeah. This was an awesome picture. She fell asleep in my hand and I carried her around until she woke up. :) She had a litter and gained a few bazillion pounds since then, though. :)

Sandisk1duo (author)2009-03-21

How about adding a socket?

klee27x (author)Sandisk1duo2009-03-21

Well, adding a socket it ok for 1 type of chip. But this can program a lot of different chips. Many have different pinouts. So I prefer to just leave a port where you can plug in a 5 wire cable. Anyway, AFAIC the best way to program a DIP chip isn't with a socket. I've tried that. During debugging, you'll end up programming a chip dozens of times. Regular sockets are a PITA to put the chip in and out. ZIF sockets are slightly less of a pain, but they are sorta fragile; they don't last long in my hands, anyway. I prefer to wire up the programming connections to a breadboard, permanently. It's easier to use than a regular socket, and you can program in-circuit. Another nice thing to use is a chip clip. This it a plastic spring clip that goes over a DIP chip. It is quicker than any socket, and it can do ICSP even on chips that are soldered onto a PCB.

Sandisk1duo (author)klee27x2009-03-21

so, would it be possible to program all types of PIC chips with this?

klee27x (author)Sandisk1duo2009-03-22

Nope, not all. Theoretically it could program pretty much all chips that can operate at 5V. But in reality, it depends on what the software you are using supports. Back when I made this, I used PicPGM software. Some of the older, more "obsolete" chips weren't supported, such as the 10F and many of the 12F series chips. And 18F series chips were also not supported. But most all the recent 12F and 16F series flash chips were supported. This includes a good variety of 8 pin, 14 pin, 18 pin, 20, 28, and 40 pin chips. But if you used a different software, you might be able to program different chips. I think the other one I used was called WinPic, or something. Using that software, you could program a good bit of the 18F series. Nowadays I use Microchip's PicKit2 programmer, so I'm not really up on the latest free programming softwares.. :)

klee27x (author)klee27x2009-03-22

Just as an FYI, even some of the nonsupported chips can be programmed, sometimes. What you do is set the software for a similar chip, with the same instruction word length and memory size, but then you have to read the datasheets to figure out how to set the configuration registers, manually, in hexadecimel. So it's a pain, but it can be done.

Sandisk1duo (author)klee27x2009-05-23

is there any way to extract code from a microprocessor?

jhong710 (author)2009-04-13

i cant see where to put the pic here.. where do i put the chip to be programmed??

klee27x (author)jhong7102009-04-13

From the header, you can plug in whatever you want. Sure, you can permanently wire a socket if you want. But I'd rather plug in a socket when I need it, because I rarely program a chip using a socket. And even if I did, there are many different chips you can program with this and many different pinouts. I've seen clever setups where a large ZIF socket is wired with multiple connections, so you can program several types of chips by placing them in different spots/orientations. But I'd rather not need to refer to a manual just to figure out how to use my own homemade programmer. :) When I get need to program a new chip, I look at its manual and hard-wire and/or breadboard a new programming adapter.

tubbychick3n (author)2009-03-24

Haha. Your cat is so cute. I remember when my cat was that small.

barthie (author)2009-03-03

if i just follow the schematic and not the instructions, do i still need the resistor network? i find the instructions a little confusing. also, has anyone tried this with a laptop? thanks

klee27x (author)barthie2009-03-03

Nope. Just follow the schematics. I also find the instructions very confusing. I no longer own a laptop with a parallel port, but I had one at one point BEFORE I made this particular version of the programmer. On other variations of the TAIT I had made, most did not work with the laptop's lower port voltage. I managed to make a version that worked with the laptop, though. What I did ended up doing was using a quad comparator to buffer all the signals so I could manually set the logic levels to whatever I wanted. In this case, you just need to reference the comparator inputs to a low voltage, like 1.5V, and you're all set. Now any voltage that is higher than 1.5V will switch the comparator, and there's your new laptop compatible logic level. So basically, you can replace all the 4 npn transistors with a quad comparator IC, if necessary and you know what you're doing. You don't even need the pnp to control the programming line, because the outputs of an LM339 are open-collector. They can be pulled up to whatever voltage you want. So you end up providing programming signals with pullups.. which means the output impedance is fairly high, but it should work ok as long as you're not doing ICSP with a lot of circuitry loading down those pins on your micro.

barthie (author)klee27x2009-03-04

sorry, i'm just learning, so you lost me. i looked at the datasheet for the 339, but couldn't quite figure out how to replace the four npn transistoer with the chip. thanks for the reply though.

klee27x (author)barthie2009-03-04

Yeah, np. Maybe it would help to learn the theory behind it. Basically a comparator has 2 input pins and one output pin for each comparator. One of the input pins is usually set to a reference voltage from an external source. Then a signal is applied to the other input pin. When the voltage on the signal goes higher than the reference voltage, it makes the output pin change state. The way a comparator works it basically the same as an opamp, except it has a couple extra transistors on the output to make it go "all-or-nothing," which makes it work well for this app. For this particular app, you would make a voltage reference of 1.5V-2V anyway you want... with a resistor divider or using a voltage reference IC, or whatever. Then connect that reference to all four of the chips I(+) pins. Then anywhere you have a transistor, you connect the part that goes to it's base to one of the comparator IC's I(-) pins. The output of the comparator is what's called an "open-collector" output. So it's really just a transistor collector, itself. That goes where the transistor's collector would go. Pulled up to the positive rail and becomes the output signal. Well, I know that confused you even more. But I'm sure you'll figure it out if needed. Necessity is the mother of invention.. or of learning stuff. :)

barthie (author)klee27x2009-03-04

maybe i understood better than i thought. i started drawing it out with the reference going to all four + pins of the lm339, but wasn't sure and tossed it. i'll give it another try tomorrow. thanks!!

klee27x (author)klee27x2009-03-04

The whole point is to move the place where your programmer decides what's hi and what's low to a new, lower setpoint, so that it works with a laptop whose parallel port voltage might be 3.0-3.5V, rather than the 5V which is (loosely) standard for desktop machines. At 5V, the transistor circuit may require a signal to go up to 3.5Vish before it is considered a "hi." By setting the comparator reference to 1.5-2.0V, it now makes it work with practically any voltage.

agis68 (author)2009-02-02

Nice project i will try it. By the way cute cat

klee27x (author)2008-03-11

it'll work for some pic18F's. To see, you have to look at the programming software you plan to use to see what it supports, then also you have to find out if it's supported on the TAIT programmer, which this basically is.

little_dice (author)2008-03-03

This is really awesome what you've done here... I just wanted to know if the same rig can be used for a pic 18 series microcontroller...for sure... A speedy reply would be greatly appreciated...

James (pseudo-geek) (author)2007-07-13

cpl questions: no.1 can I please have your cat. no.2 I dont have that port on my pc I dont think - any way to use a USB port ot program it?

there should still be a serial port on your PC!!!!!!! what kind PC do you have?? i have one that was bought this year and it still has a serial port on it!!!!! it should be the one labeled with the 1010 it should be a kind of turquoise colour and have either 9 or 25 pins Hope this helps

I'm sorry, it does have one. is the serial port the printer port or the smaller ones?

The printer port is a parallel port the serial ports are male 9 or 25 pin ports!!! the printer port is a female connection!! but this programmer needs a parallel port so the one you want is the printer port!! kk TechnoMancer

And if you want to build a PIC programmer then build the one thats called a Business card pic programmer here:
that one is completely powered by the serial port and so is more compact!!!

burzvingion (author)TechnoMancer2007-09-29

While building a PIC programmer is all very well and dandy, it's really more work than its worth in my opinion, unless you only plan on using last century's 16F84s all the time. if you're really serious about getting into microcontrollers, the PICkit 2 is what you want. It can handle most any 10, 12, 16, or 18F device microchip has come out with, all the way up to a good number of 24F and dsPICs. It uses a USB interface, so it's very fast, and it comes with a software interface thats easier to use than a microwave. And they include a pretty nice C compiler to boot. To top it all off, you can buy it for $50. If you feel like making your own breakout board, and don't need a C compiler, you can get just the ICSP programmer for $35.

TechnoMancer (author)burzvingion2007-09-29

you could always build a pickit2 programmer the schematic is in the user guide pdf, they provide the hex file for the pic inside and you just need to find someone to program that for you and you can build the rest!!!

burzvingion (author)TechnoMancer2007-09-29

While that does sound appealing, and yes, you could probably find all the parts needed for less than $35 (though not much less), it would probably be much larger if you use thru-hole components. If you open up the case, you can see that every single part used is surface mount, from the chips to the resistors and capacitors to the inductor, so the chances that you have very many of the parts laying around is slim. No matter what, you need to make a pcb for it. the PIC used is an 18F2550, but it can be programmed via usb once it has a usb bootloader... So you could borrow a programmer from someone else to get the bootloader on it, or there are probably preprogrammed chips available somewhere. The good news is, you can download the software programmer from microchip's website. So I guess in conclusion, yes, you could probably save a few bucks by making your own, but it will take you a while, and probably won't be as compact as the original.


funlw65 (author)2007-09-08

What if I using a separate PC source for 5V and 12V instead of LM317 and LM7805 (I have both regulators)?

Puotta (author)2007-07-19

Has anyone verified that this works for a pic16F84a? I'm having trouble with mine, and after reading all of microchips documentation over icsp, it seems like the data I'm getting from my programmer is correct, but I'm still not able to burn them. I'm using icprog, and I swapped the 9volt for the 12volts from my computer.

klee27x (author)Puotta2007-07-20

you inverted the data in/out and clock signal, right? And you left mclr signal non-inverted? And if using Win XP, you added the Driver that is necessary to run ICprog on WinXP? After downloading the driver, you also have to activate it. It is rather nonintuitive, so please check with the ICprog instructions for more info.

Puotta (author)klee27x2007-07-20

yea I inverted everything. My setting look exactly like those in the picture. And I'm running this mess on a win98 computer. I'm gonna do some more tests today and see if I can't figure it out. Thanks for being helpful so far, I'm sure I'll have (hopefully a more specific one but still) a question or so for you later.

Puotta (author)Puotta2007-07-20

muhahaha, I finally finished it. I burned a program onto the pic. It verify's and reads correctly. Unfortunately I haven't gotten a chance to check it in the test circuit, (I'm missing the correct capacitor). Either way, I'm pretty sure its working just fine. Oh the problem was just a messed up transistor. When I pushed it into the breadboard the leg bent, and I missed it. Eh well.

klee27x (author)Puotta2007-07-22

Kewl! Glad it's working. I was starting to wonder if my schemmy contained an oversight. But didn't you mean to say "muahahaha," i.e. evil scientist laugh? "Muhahaha" doesn't sound right to me. :)

Puotta (author)klee27x2007-07-22

hmm... I never realized I was typo-ing that... hmm... eh well now that I know I'm evil laughing properly I shall rule the world! muahahahahahaha! As far as I know your schematic is fine. Unless I changed something during my "poking" (proper engineering term). Well once I finish up a couple other projects I've got going on I might see if I made any mods... probably not though, I'm not that smart ;)

klee27x (author)Puotta2007-07-19

I have verified it, personally. I have burned with a fresh 9V battery, even, but have found it takes 8.8V minimum to burn my 16F84a, using this exact programmer pictured. So 12V is definitely better.

Puotta (author)klee27x2007-07-20

the one the schematic portrays? hmm. any probems you had, that I should look out for?

binnie (author)2007-01-26

that is cute and i love it, oh the instructable was also good hahaha ( it means i like the cat lol ) and this is a great way o program pics on the cheap and because of the icsp that makes it great for my applications ( smd, its hard to remove chips, and they dont fit in normal programmmers ) i recon i can sleep easy now cause i found a way to program them lol Binne

klee27x (author)binnie2007-01-26

Thanks. I'm glad you figured out how to make it from my pics and words... I still haven't found the patience to create proper schematics or boards, yet. Incidentally, while playing with my adjustable power supply, I found that all of my modern pics enter programming mode with just around 7.6V. My "vintage" 16F84A is programmable with 8.8-8.9V or so. I guessing that only the really obsolete chips need 12.5V. Bottom line here, I modified my programmer with a couple diodes and a switch so it can also run off a 9V battery, which bypasses the Vpp regultator (thus does not incur the 1.3-1.4V drop that the lm317 regulator causes.) It tests good with all my pics, though the battery life for programming 84A will be short, I don't see myself ever using that chip, again.

binnie (author)klee27x2007-01-26

ive seen a few kits that can run off 9 volt batteries so i was thinking they might use a power boosting type thing or something but now you say that, that makes sence as for the boards and all, i recommend EAGLE ive had no trouble with it, you draw up the schematic save and all then theres a little icon up the top that sends it to the board designer you place the parts where you think they will be best ( or whereever yoo want ) press the auto route button Presto freee boards desisign then mirror it, print it out on time magazine paper ( or the expensive toner transfer ) then iron it on fill up some plastic container with ferric cloride, heat it up and stir it round ( or use a bubbler if you have one, and fish tank heaters work well) leave it there for a few mins -- until all the copper that you dont want is removed but dont leave it too long ( for extra re assureance that its gone ) because it will start to etch the tracks from underneath oh and i havnt built it.... yet The power supply page dosent have a schematic at all there is one here in the last step from what i can see if you label the pins left to right 1,2 and 3 PIN 1: positive-in PIN 2: common/ ground PIN 3: output

klee27x (author)binnie2007-01-26

Yes, that's how most 7805's are pinned. Check your particular parts datasheet to be sure, though.

binnie (author)klee27x2007-01-26

still dosent tell me what to do on the power supply cuircut

klee27x (author)binnie2007-01-27

click on the link I provided for the lm317 in one of my comments for that project. Choose components to give you the range you want. Insert a potentiometer for R2. There's your adjustable power supply.

binnie (author)klee27x2007-01-29

i think inserting that pot on r1 would be a better choice but r2 will work. r2 is there solely to prevent a short, acting as a load. the output on the 7805 to pin 3 on the pot the wiper to the supplys output and the 1st pin on the pot to r2 that makes sence. THANKS FOR ALL YOUR HELP... ive got a old scanner supply im going to take the wall bit off and wire it to a IDC pluf ( the kettle cord ) and put it in a metal enclosure that my dad had since hed been activly doing electronics ( lol thats old 15 years or so ) he can still do alot more than i know about but who gives.... Before i go out and order, how hot does it get.. i see im on the wrong page, but im just continuing the convo. if it gets hot, i will go out and buy a fan to mount on the case but i will have heatsinks, or sink it to the case when i build it

klee27x (author)binnie2007-07-22

Oh, in terms of V1 or V2, there are example circuits in the various manufacturer datasheets that I followed. If you want to deviate from them, you might end up figuring out for yourself whey they choose to replace R2, rather than R1, with the potentiometer. I am sure there's a good reason.

About This Instructable




More by klee27x:Stow-Away Whiteboard and Magnetic Tool HolderSoldering to Desoldering Station HackMinimalist Bench Sander
Add instructable to: