PIC programmer

PIC Programmer – PicPgm

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.

37 thoughts on “PIC Programmer – PicPgm”

    1. 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.

  1. 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!

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

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

  2. I’m using a real serial port.

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

    Thanks!

    1. 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.

    1. 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.

    1. 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.

  3. 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

    1. 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.

  4. 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.

    1. 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.

      1. 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…

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

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

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

    1. 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.

Leave a Reply