While we’re still working on the next workshops, here’s a very simple and useful mini project, a low cost 40 pins PIC programmer using the serial port.

Micro-controllers play a very important role in electronics, as they are able to perform tasks in automation, control, image processing, among others. Their usage is immense. There are various families of micro-controllers, one of those is the Microchip’s PIC (Peripheral Interface Controller). PICs are very popular as they are relatively cheap and because of their characteristics, for example their low power consumption, internal oscillator and free development tools.

This is an example of a very simple PIC programmer:

esquematico.png

As shown above, there are only three 4,7k resistors connected between the DB9 connector and the PIC. According to the schematic, these resistors are connected to the following pins of the PIC: MCLR (1), PGC (39) and PGD (40). The pin no.8 from the DB9 connector is connected to the PGD pin (40) in the PIC.

This programmer operates at 5V DC. Therefore, an external voltage source must be connected to the 2-pin connector.

Using the KiCad software, a PCB layout was designed:

pcb-picpgm.png

Then we started making the PCB, first we printed the layout on an acetate sheet. Then we used the UV exposure method to transfer the circuit to the board and for last, we corroded the PCB with iron perchlorate.

And the programmer is ready to use! Here’s how it looks:

picpgm-final.jpg

These are the steps to use the programmer:

1. Connect it through a serial cable to a computer;
2. Plug in the desired PIC on the board, for example, the PIC18F4550;
3. Using an IDE, MPLAB for instance, write, compile the code and generate the .HEX file;
4. Through a programmer software like PICPgm, send the .HEX file to the PIC.

And there you go, the PIC is ready to use and you got a new programmer for 40 pins PIC micro-controllers.

Categories: Projects

Hugo Santos

IT and Electronics Engineer | Maker

39 Comments

Ibrahem M. ElǮasy · 27/11/2013 at 17:32

can i use pickit2 as aprogrammmer software

    eLab · 02/02/2014 at 18:18

    For what we’ve tested, it seems that pickit 2 software always searches for a USB connection, since this programmer uses the DB9 RS-232 connector, it is not detected by the program.

ahmed · 17/01/2014 at 20:27

can you please upload the pcb board file

Guilherme · 09/02/2014 at 17:29

Hello,

I did the programmer.

But when i tried upload a .hex file appered a error.

So i measured the voltage in MLCR and gave me a – 0,11 V, a really weird.

Can you help me? Or can give me an idea?

Thank you!

    eLab · 10/02/2014 at 00:18

    Sometimes the voltage in the circuit oscillates and you get weird measures like that. What software and external supply did you use?

    Guilherme · 10/02/2014 at 09:40

    Thank you for your answear!

    I’m using the Picpgm and USB like external supply.

      eLab · 12/02/2014 at 01:28

      No problem!
      Then it should work with no problem. Are you using a real Serial port or a USB to Serial converter?

Guilherme · 13/02/2014 at 09:40

I’m using a real serial port.

But I tried to use in another computer and it works!

Thanks!

    eLab · 13/02/2014 at 19:42

    Glad to hear that!😉

kaupo · 31/03/2014 at 10:43

Does this solution works with other pic than PIC18*?For example with PIC12C508?

    eLab · 02/04/2014 at 23:56

    This programmer works for some other 40 pins PICs. However I don’t know if it works for PIC12C508. From what I’ve seen from the datasheet, I don’t think so.

Muhammad Navaid Arif · 31/05/2014 at 16:06

can we use this programmer for PIC18F452 ?

    eLab · 01/06/2014 at 03:32

    Yes, it should work.
    We tested this programmer with PIC16F877, PIC16F887 and PIC18F4550, so all you have to make sure, is to check if the pins VDD, VSS, MCLR, PGD and PGC are in the same place as PIC18F4550 for example. If they match, is very likely that this programmer will work.

Deep · 20/09/2014 at 03:09

Does this work on usb to serial converter? Because I don’t have serial port on my laptop

    eLab · 22/09/2014 at 09:05

    It probably won’t, for most converters, since many of them only use the absolutely necessary pins for communication. In this case you must make sure the converter internally creates the auxiliary pins, like DTS, CTS and RTS. Additionally, the voltage levels of the converter must be high enough to program the microcontroller, and they usually are quite low. It is possible though, but it is not as easy as it seems.

Ismail · 30/09/2014 at 00:37

Hello eLab
Thank you about this great work, its the first that I see a very nice and simple programmer, but I have a question I’m someoone who is new I started by the 16F84A, so This Programmer works with 16F84A

    eLab · 30/09/2014 at 08:53

    Hello! Thank you! Well this programmer is focused on 40 pins PICs, however, if you respect the connections, most PICs will work, just make sure to verify on the datasheet to know where the power, MCLR, PGC and PGD pins are. So, as long as you connect these pins in the right place, PIC16F84A should work! To give you a little bit more help, on PIC16F84A, VDD is 14, VSS is 5, MCLR (or VPP) is 4, PGC (or RB6) is 12 and PGD (or RB7) is 13.

      Ismail · 30/09/2014 at 16:09

      Thank you very much, you are my hero !!!!

saravanan · 05/01/2015 at 16:59

i have made this three resistor programmer for pic16F877A microcontroller. when i connect it to PC, the picpgm programmer software detects programmer as jdm programmer, but it says NO PIC found. what might be the problem. i am using serial port as per circuit diagram, external power supply of 7805 regulator output. please help. my friend suggested to connect oscillator and capacitor in circuit. what should i do. thanks.

    eLab · 05/01/2015 at 22:14

    Hey! Sorry to hear that. Well it appears you have everything in order.
    However, when the programmer is detected but not the PIC, usually means that the power supply might have a problem, but if you say you’re using a 7805 regulator it should work. The oscillator and respective capacitors are not necessary to program the microcontroller. Try using a different, more stable power supply, like an old 5V cell phone charger and make sure you’re powering the 4 power pins f the microcontroller. Some people with similar problems were able to make it work trying different computers. You might also want to check with a different PIC.

saravanan · 06/01/2015 at 14:08

thanks for your help. i found out the problem. it works.

    eLab · 07/01/2015 at 00:44

    No problem! Glad to hear that🙂

    Omar · 05/02/2015 at 21:01

    please help me ihave same problem

      saravanan · 05/02/2015 at 04:05

      Omar use USB power supply for programmer. please don’t use temporary connections such as breadboards. solder the circuit in pcb board or dot board. use multimeter to check continuity. make sure power supply goes to two sides of microcontroller (+5v to 32,11 pins and gnd to 31,12 pins). don’t use long or low quality wires for programmer. thats all. thanks…

        Omar · 06/02/2015 at 07:40

        Thank you I will test that … but please how use usb power supply

        i test with a voltage regulator >> and electronic power supply

    Omar · 06/02/2015 at 09:53

    Thank you it works now

youcef · 13/02/2015 at 16:12

thanks man for that
can I use nother software like picpgm?

    youcef · 13/02/2015 at 16:16

    ah I’m sorry I mean microC

    eLab · 13/02/2015 at 17:15

    Yes, you can use any development platform you want as long as you get the .hex file to upload to your microcontroller.

abhishek · 27/01/2016 at 21:32

what does 4,7k ohm means.47k ohm or 4.7k ohm

    eLab · 27/01/2015 at 22:25

    It means 4.7k Ohm.

    Omar · 05/02/2015 at 20:55

    pleas help me i have same proplem

htoozinkyaw · 09/10/2016 at 08:31

hi
plz,help me i need piano pic program.

razer · 17/03/2017 at 09:37

Your project can be adapted to a PIC16F88?

    João Duarte · 13/06/2017 at 10:20

    Sure, it should work fine. If you respect the connections, most PICs will work, just make sure to verify on the datasheet to know where the power, MCLR, PGC and PGD pins are. So, as long as you connect these pins in the right place, there shouldn’t be a problem.

GURU · 02/11/2019 at 17:34

Hi, can I use a USB to Serial converter? MAX232 IC is required? Thanks

    João Duarte · 04/12/2019 at 17:11

    As long as your converter as all the necessary pins and correct voltage, it should work fine.

Leave a Reply to Guilherme Cancel reply