Using An ATmega8 To Program PIC24FJ Chips

[Fezoj] likes to play around with microcontrollers and decided that he wanted to try a Bus Pirate as a new tool in his adventures. Since it’s open hardware he had his own board made and populated it himself. The trouble is, he works only with AVR chips and doesn’t have a PIC programmer. No problem, he figured out how to flash the PIC24FJ using an ATmega8.

To get started, he grabbed a copy of the flash programming specifications from Microchip. Once he had implemented the protocol in the AVR code, it was just a matter of getting the downloaded PIC firmware to the AVR. An RS232 chip gives him the serial connection he needs, with the help of his own programming software written with Visual Studio.

It’s not a robust solution for prototyping on the PIC platform, but maybe it could be developed for that purpose. For now, all he needed was a bootloader so that he could flash the Bus Pirate via a USB connection.

[via Dangerous Prototypes]

18 thoughts on “Using An ATmega8 To Program PIC24FJ Chips

  1. Could I program an ATMega48 using my 328P Nano? I’ve seen examples of people using the bigger Arduinos to program ATMegas, but it usually involves removing the IC which is impossible on a Nano.

  2. This is pretty awesome – been looking for an AVR-based PIC programmer for a while.
    Perhaps you could use this to bootstrap one of the many PIC-based PIC programmers using an AVR

    1. I am going to use the new pic32 ( mx1xx ) in the near future, and I only have a pickit2 also. Could you not program it by selecting a supported chip (mx3xx/mx4xx) of the same flash size? The flash programming specs seem to be the same for the entire pic32 family.

  3. Note that he is using 3v3 for both the AVR and the pic. A 5v arduino could probably be used with 5V pics, but a separate supply or a translation would be needed for arduino -> 3v3 pic.

  4. While good for the one off programming of a pic I wouldn’t recommend it as a full time method. Believe me I tried all the cheap routes, the serial port programmers, the parallel port programmers, every proto board and breadboard circuit I saw and nothing compares to using the microchip pickit. The problem you run into with pics is there are so many variations between chips that your software has to support them and not a lot of the pic program software is kept up to date anymore. Spend the $40 , it is well worth it for the pickit.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.