[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]
I like Visual Studio, I have an old version. But would not have thought to use it for programming Microsoft, cool!
That a great idea. I think it could be easily implemented into the arduino so it could some pics.
so…would this work on an arduino as well? would make it nice and easy to switch to pics.
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.
@nexekho ~ You can definitely do that, and it doesn’t involve removing the IC. Go to the bottom of the page for a breadboard example.
http://arduino.cc/en/Tutorial/ArduinoISP
I did something similar with for a PIC12 a while bac.
it’s like microcontroller sex
I was thinking the same thing :D
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
I should try this on those new pic32’s, specifically the DIP versions. :P
PICkit2 does not support them, only pickit3, and I don’t want to shell out 30 bucks, so this is worth a shot I presume.
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.
I’d also like to see an arduino program a pic32.
Just go to Microchip site and download the flash programming specification.
I’m now thinking if this would be something that could be used to dynamically re-programm the PIC chip… *inspirationstrikes*
Not advisable given the write cycle limit.
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.
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.
Update, the code on their repo no longer compiles, so I updated it! The new repo is at https://github.com/weblinux/ApProg.