Arduino can program PIC too!

This is a wiring diagram that [Soranne] put together when developing a method of programming PIC microcontrollers using an Arduino board. You can see that he takes care of the 12V issue by connecting the Master Clear (MCLR) pin to an external source. This comes with one warning that the Arduino should always be reset just before making that connection.

He’s tested this with a 16F628 and is happy to report that he can successfully flash the program memory, but hasn’t implemented a way to write to the EEPROM as of yet. This should work for any of the 16F family of chips, but we’d bet this will be extended if some knowledgeable folks decide to lend a hand.

On the PC side of things [Soraane] has been working on a program to push code to the Arduino via the USB connection. He’s developing it in C# and even has a GUI worked up for the project. You can get your hands on the software in the second post of the thread linked above but you’ll have to be logged into the Arduino forum to see the download link.

We think the 12V issue is why we don’t see more roll-your-own programmers for PIC. But there are a few solutions out there like this ATmega8 version.

Comments

  1. Drake says:

    Why no transistor to turn on 12v to pic?

  2. Douglas Bouttell says:

    All this needs to do is allow in-circuit debugging and use a step-up converter to generate 12V like the PicKit and I’m sold!

  3. MikeK says:

    Arduino also comes over every two weeks to clean up PIC’s apartment.

  4. killersquirrel says:

    What madness is this? I call blasphemy!!

  5. Joe says:

    Probably slower than a snail

  6. Jarel says:

    Cool!

  7. Chris says:

    “We think the 12V issue is why we don’t see more roll-your-own programmers for PIC.”

    Personally, I’d say it’s because Microchip sells a top-notch programmer that works with their entire product line, and has in-circuit debugging, for a very reasonable $45. Or go with a Chinese clone for $25, if you’re willing to sacrifice quality control and support. Anything less than that is false economy, which you’ll soon regret if you’re doing anything beyond the most basic experimentation.

    • Ac says:

      You’re not wrong, but you’re not right either. Everyone knows to buy or make a programmer if they are ‘serious’ (professional).

      The amount of people experimenting is huge… Look at the number of people using Arduino as an AVR programmer.

      I’ve seen some great PIC tutorials and circuits I would love to build… Maybe to keep, maybe to hands on discover/tweak and convert to AVR. Could I afford a PIC programmer? Sure… But this IS just a hobby, and I already spent enough on it than I ever intended. It makes sense to avoid buying a $50 adapter if you can, from this perspective.

      • asdf says:

        Call me lazy, but we don’t have the time to build the programmer when a cheap alternative exists. I would catch all kind of hell from my boss if I said… “Although the perfect solution only costs $45, I’m going to spend a few weeks building something that’s almost as good.”

      • Chris says:

        Well, I’m not serious if it means professional. :) Professionally I’m a desktop programmer, and PICs are just a hobby. Even as a hobby it’s best not to skimp on some basic tools.

        But my goals are self-education and creating original projects, so I’m looking at it from that perspective.

        You do have a point that if someone’s goal is mainly to replicate an existing PIC project, and otherwise has no significant interest in working with that particular platform; then it makes sense to get the job done with whatever tools are already at hand.

  8. steaky says:

    does anyone know of working the other way round – using a PIC to program an AVR?
    Whenever I google it, i get the way described here.

    • asdf says:

      Yes, but why would you want to? The point of buying the expensive (compared to a sub $1 PIC) Arduino is that it already has that functionality built in.

      • steaky says:

        well, im i PIC guy through and through.
        I’ve got and IDC2, IDC3, and PicKit3.

        I was looking at extending knowledge so got a free sample of some AVR (i think it was an atmega32U4), but didnt have any way of programming it.

        I didnt want to subscribe to the whole arduino thing as it has too many flaws, plus not really something that it useful in a commercial environment, imo.

  9. Cr says:

    http://dangerousprototypes.com/2010/04/07/program-your-avr-with-pickit2/
    Use pickit2 (which is essentially a pic18f2550) to program AVR
    The site seems dead though…

  10. NewCommentor1283 says:

    1) cool and lol
    2) noone has EVER heard of seperate 12v powersupply???
    i mean desktop computers ALL have dual +5/+12 supplies, in fact, nowadays they all have +3.3 ;)

    im confuzzled.
    why someone would use a step up converter for the 12v???
    it used to be that ppl used 12v wall warts and used a 7805 for the 5v and decoupled/buffered the 12v(10-14) for 12v! zener it if you need to.
    is my thinking too simple??? or am i just off today?

    • NewCommentor1283 says:

      or have i been wrong for years and the PIC chips need NEGATIVE 12v ??? i would assume they need POSITIVE 12v ???

      PS:
      i think inverter for +12 is ridiculous.
      i think inverter for -12 is,,,
      already in my projects (VFDisplay and RS232)

      • Pete says:

        The official PIC programmer does it the other way round: it’s powered from USB 5v, and generates 12v with a boost converter. This eliminates the seperate power supply, which is a handy benefit if you’ve already got a crowded desk and set of sockets.

  11. Brian says:

    There are so many ways to create 12v. It can not and should not be a problem. And then use a few transistors or an opamp for turning it on and off.

  12. kirill says:

    I wrote an arduino scratch a few weeks ago, which can program PIC18F2550 and almost all PIC18F2/4Family with slight modification it can be downloaded here:

    https://sites.google.com/site/thehighspark/arduino-pic18f

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 92,428 other followers