I'm referring to the PIC microcontrollers, specifically the 16f and 18f series - could the GPIO be used in this way?

If so, how?

  • 1
    I am not entirely sure how but I am 90% sure you can do this. Jun 13, 2012 at 14:05
  • 1
    @ShaneHudson Nice answer ;)
    – Jivings
    Jun 13, 2012 at 14:08
  • One thing to do might be to see if there's an old parallel port programmer available. Change the pin fiddling code to use gpio and you may have a working programmer.
    – XTL
    Sep 13, 2012 at 7:27
  • See also raspberrypi.org/phpBB3/viewtopic.php?f=44&t=8635 (avrdude, but same idea)
    – XTL
    Sep 13, 2012 at 7:29

4 Answers 4


Older PICs relied on the programmer to provide the timing for programming the Flash. I suspect that the RPi would be capable of getting those timings correct. The main difficulty in that case would be the level conversion from 3.3V to 5V for the PIC

Newer PICs do the programming timing internally and some can be programmed at 3.3V. Those should be able to be connected directly to some IO pins.

Now you have the read the programming specification for that specific PIC family and work out how to manipulate the GPIOs to get the program in there.

It will be quite interesting if you get something working.


Pins 8 and 9 can be used as UART pins, so it should be possible to control a programmer over these pins.


Software-wise, there is an open source pic programmer program for linux called odyssey. It is used with programmers connected to a parallel port. Odyssey communicates by bitbanging, so it should be possible to adapt it to send the data to the GPIO instead of a parallel port. Odyssey supports a lot of the 16f and 18f PIC:s, and is able to read several formats of HEX files.

Another open project for pic programming is usbpicprog. This one could also be worth a look, but it is more complicated as it is a programer connected to the USB port, built around a pic18f2550. This programmer has a great feature: it generates the +12V programming voltage with a charge pump, thus it doesn't need any other power source than +5V over USB.


See an example (via), and a reportedly more advanced one (via) describing how to use of Raspberry Pi to program PICs via GPIO.

Note that these circuits require an external 12V power source, and a few additional components (voltage regulator, transistors, capacitors, resistors, and some LEDs in the advanced one).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.