Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

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

If so, how?

share|improve this question
1  
I am not entirely sure how but I am 90% sure you can do this. –  Shane Hudson Jun 13 '12 at 14:05
1  
@ShaneHudson Nice answer ;) –  Jivings Jun 13 '12 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 '12 at 7:27
    
See also raspberrypi.org/phpBB3/viewtopic.php?f=44&t=8635 (avrdude, but same idea) –  XTL Sep 13 '12 at 7:29
add comment

4 Answers 4

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

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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