Programming a PIC

From RepRap
Revision as of 14:10, 23 July 2015 by Glenn (talk | contribs) (wiki)
Jump to: navigation, search

The RepRap project uses PIC microcontrollers as the processors for each control board. These need to be loaded up with the appropriate firmware before they will operate properly.

You will need:

  • a PIC16F648 chip
  • a PIC programmer
  • PIC programming software
  • the firmware .hex file
  • a computer with a serial port (or parallel, depending on your programmer.)

Insert the chip

If you use a PG2 or PG3 PIC programmers, with the spring type socket, it is not necessary to fully insert the chip. In fact, this will make it very hard to get out. Instead, what you want to do is insert the legs of one side of the chip into the socket, push gently until the legs bend far enough to allow the second set to be inserted. Then in one smooth motion, insert the second set of legs and release the pressure. The springiness of the legs will keep them in contact while you program the chip.

Keep in mind that gently is the keyword here. You only need to use two hands to keep yourself stable. Use the minimum force required. If you push it in all the way, it will be very hard to get out and you will most likely end up severely bending some legs. Its not the end of the world, as they can be bent back, but its not something you want to happen.

Program the firmware

You'll need the firmware files. The easiest way is to download them from SourceForge.

If you would like to compile them from source, we have instructions on how to compile them.


  • Piklab has been used successfully by at least one builder.
  • I need to test the Olimex PG3B with gpicp. Not sure how that works.
  • PikDev has a programmer that works fine and is part of Ubuntu.


Use ICProg, a free PIC programmer, and follow the instructions on

Remove the chip

Be very careful removing the chip. Make sure the force you apply is only vertical, and not side-to-side. If you happen to bend any legs removing the chip, gently bend them back. Your chip is now programmed and ready for use.

In-circuit programming

Fed up with bending all the PIC pins every time you take them in and out to program them? The RepRap boards are designed for in-circuit programming; for details see here.