Raspberry Pi as a PIC programmer

[Giorgio Vazzana] turned his Raspberry Pi into a PIC programmer using a rather small collection of common parts. It supports about a dozen different chips from the 16F family. But we’d guess that software is the limiting factor when it comes to supporting more chips.

Generally the problem with PIC programming is the need for a 12V supply. He chose to use an external 12V supply and a 78L05 linear regulator to derive the 5V rails from it. With the power worked out there are some level conversion issues to account for. The RPi provides 3.3V on the GPIO header pins, but 5V logic levels are needed for programming. He built transistor and voltage divider circuits to act as level converters. The programming software bit bangs the pins with a write time of less than eight seconds per 1k words of program data. So far this does not work with ICSP, but he plans to add that feature in a future version.

Comments

  1. steve says:

    That wins the prize for the most crazy overkill ever.

    • M4CGYV3R says:

      Yeah, at about $30 I think a PICkit would do just fine. This might be worth it if it works for some of the crazy complex chips that require special programmers, like the 32-Bit series. The programmers and debuggers on those things are terribly expensive.

  2. jack c says:

    Maybe overkill, but actually quite useful. You need this PIC programmer and you don’t want to buy it. You just happen to have a Raspberry Pi lying around. Bingo.

    I might actually use this…

    • AC says:

      Exactly.

      All of the naysayers know this is NOT targeted at professionals or even serious hobbyists. (Yet the negative comments still bring out the dramatic obvious objections).

      I’ve seen a few PIC projects that I like. I don’t want to learn PIC like I want to learn the Atmel side. But I could follow verbatim the PIC projects/tutorials I have seen, like those on the web or the awesome Make: Electronics book.

      I’m in awe, not because this is super clever — it’s probably easy for a moderately experienced circuit builder. What I am in awe of is gratitude that someone would build and _document_ this. Thank you, Giorgio!

  3. lee says:

    could probably replace the resistors and transistors with an octal transceiver like this

    http://focus.ti.com/lit/ds/symlink/sn74lvc245a.pdf

    and the pin across from the 3.3V is a regulated 5V, so no need for linear regulator either. just have to tie the external power supply’s ground to the raspi’s ground(and put the 12V+ far, far away from any part of the raspi)

    • lee, thanks for your comment, but I think that octal transceiver wouldn’t work. When programming the PIC, CLK and DATA have Schmitt Trigger inputs, and they need a minimum input high level of 0.8*VDD, that is 4V. If you operate the 74LVC245 at 3.3V, the VOH of this transceiver (3.3V at best) isn’t enough to be recognized as a valid high level from the PIC. Moreover, I added the 78L05 because I didn’t want to draw any current from the RPi, apart from that needed to drive the bases of the switching transistors. I agree that you could probably build an interface with a lower number of parts, but as it is now its cost is probably under 2€, you can use any type of equivalent npn/pnp pair (like bc547/bc557) and it’s something a beginner could solder easily as a first project.

    • Giorgio Vazzana says:

      lee, thanks for your comment, but I think that octal transceiver wouldn’t work. When programming the PIC, CLK and DATA have Schmitt Trigger inputs, and they need a minimum input high level of 0.8*VDD, that is 4V. If you operate the 74LVC245 at 3.3V, the VOH of this transceiver (3.3V at best) isn’t enough to be recognized as a valid high level from the PIC. Moreover, I added the 78L05 because I didn’t want to draw any current from the RPi, apart from that needed to drive the bases of the switching transistors. I agree that you could probably build an interface with a lower number of parts, but as it is now its cost is probably under 2€, you can use any type of equivalent npn/pnp pair (like bc547/bc557) and it’s something a beginner could solder easily as a first project.

      (Sorry if this shows up twice, the first one says it’s ‘awaiting for moderation’ since yesterday)

  4. merc says:

    somebody should port flashrom to it

  5. Vis1-0n says:

    Now this is really useful if you don’t have a pickit2 and want to make a clone. It avoids the chicken and egg situation of how to put the firmware into a 18F2550. Most PCs these days don’t have parallel or serial ports, and the USB to Serial converters are hit and miss.

    The BOM including the RPi (ideally) are all junk box parts.

  6. abc says:

    Pro tip: Do not let your breadboard look like that mess.

  7. ihsan kehribar says:

    Hi,

    I recently programmed an Pic24f with Rpi via the additional help from my Little Wire project.

    My post: http://blog.kehribar.me/?p=171

    One can easily modify this program to work with only the GPIO pins of the Rpi.

    Best,
    ihsan.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,425 other followers