is it possible to program PIC 16F877A using arduino uno?
if it is possible, please tell me how to this;
2 Answers
Yes, it is possible. Is it easy? No.
You have to employ the "low voltage programming" mode (LVP) of the chip, which is enabled by default out of the factory (don't turn it off or you would need a real programmer to turn it on again):
The LVP bit of the configuration word enables low-voltage ICSP programming. This mode allows the microcontroller to be programmed via ICSP using a \$V_{DD}\$ source in the operating voltage range. This only means that \$V_{PP}\$ does not have to be brought to \$V_{IHH}\$ but can instead be left at the normal operating voltage. In this mode, the RB3/PGM pin is dedicated to the programming function and ceases to be a general purpose I/O pin. During programming,\$V_{DD}\$ is applied to the MCLR pin. To enter Programming mode, \$V_{DD}\$ must be applied to the RB3/PGM provided the LVP bit is set. The LVP bit defaults to on (‘1’) from the factory.
So you can use the Uno to send the right serial signals (similar to SPI) to the PIC16 using LVP.
The hard part is getting that serial data right.
DS39589 tells you all about the programming protocol.
-
\$\begingroup\$ thanks for your help ,but does this mean that I don't have to connect external 12 volt to Vpp as described here forum.arduino.cc/index.php?topic=92929.0 \$\endgroup\$– Ali AdelCommented Nov 15, 2014 at 20:36
-
\$\begingroup\$ Not when using LVP, no. The 12V is only for high voltage programming and is what things like the pickit2 and pickit3 use. \$\endgroup\$– MajenkoCommented Nov 15, 2014 at 20:42
-
\$\begingroup\$ in the link I mentioned the author said he tried but with no luck and here is his post "Working on LVP (Low Volatage Mode = no need for 12V) and release the code in less than one hour! PS : just received my 16F876A, so I'm gonna try! ;) EDIT : ARRRRRHHHHH having problemes with LVP :s Doesn't work, actually 16F876 don't work like 16F628, that's a bit more complicated than ithought. Anybody who want to help is welcome!" so if you can suggest a proper way for connections and programming that will be very helpful for a lot of people....thanks again and sorry for bothering \$\endgroup\$– Ali AdelCommented Nov 15, 2014 at 20:52
-
\$\begingroup\$ The propper way to download to a PIC is described in its the programming specification. Majenko gave the link, now you just have to read. \$\endgroup\$ Commented Nov 15, 2014 at 22:02
Someone seems to have done this:
- http://forum.arduino.cc/index.php?topic=92929.0
- http://www.instructables.com/id/Program-PIC-with-Arduino-1/
- http://www.pikoder.com/ArdPicProgEN.htm
(use google for more candidates)
-
\$\begingroup\$ I did so and I have already read the three topics you mentioned but I didn't get a lot of them so I was trying to find something more clear...any way thanks for your help \$\endgroup\$– Ali AdelCommented Nov 15, 2014 at 20:41
-
\$\begingroup\$ If you had read those links you knew it was possible, so why ask? \$\endgroup\$ Commented Nov 15, 2014 at 22:01