Thursday, 3 May 2012
Program PIC using Arduino Board..!!!
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.
ATmega8 Version [via Dangerous Prototypes]
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.