gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: Re: Need help getting code onto 16F877A
From: Byron A Jeff
Date: Mon, 17 Mar 2003 18:52:12 -0500 (EST)

> I want to use a PIC16F877A in my next project, but I'm having trouble 
> getting a program onto the PIC. First of all, I want to disable low 
> voltage programming.

No problem. All you need is a high voltage programmer.

> Secondly, I have tried a number of the simple to 
> build programmers in the past, and they worked, but soon failed 
> mysteriously and I was never able to get the same design, even with 
> different parts, to work again.
> 
> I have a Warp-13a programmer. I got it long enough ago that its firmware 
> does not support the 16F87xA. I also haven't seen any Linux support for 
> using the Warp-13a to put code onto a 16F87xA, so upgrading firmware won't 
> help.
> 
> In light of all this, I decided to make my own programmer using a PIC that
> I could program. I made a prototype with a 16F84 (it's in C, so other
> parts should be easily used). It can read data from other PICs. Over the
> past few days I have tried to make it write data, too, but it still
> doesn't work and I don't know how to fix it. The problem seems to be in my
> impementation of the communication between the programmer and the target
> -- the part that Microchip documents.  Ironically, they don't document
> reading as well, but that's what I got to work.
> 
> Can gpism emulate a PIC being reprogrammed by another PIC? I'd look on the 
> site, but I can't get a whole page from dattalo.com right now.
> 
> Any help is greatly appreciated. I put the code I have at
> http://ro.com/~jeffj/projects/loader.tar.bz2 for anyone who actually wants
> to look.  All GPL'd stuff. I think the problem is in PIC14.c.

Jeff,

I really think you should save yourself the headaches of trying to do it all
over again.

First off is the simple fact that the 16F877A (note the A) has a different
programming algorithm that its predecessors. That's why none of the programmers
work for it.

Secondly the job has already been done. Wouter van Ooijen's Wisp628 has 
everything but the programming socket:

* Programs 16F87XA and 18FXXX parts
* High voltage
* ICSP connector
* Serial Interface
* Programming software written in Python, so it works on Windows and Linux.

It's a no brainer. You can use your current programmer to burn a PIC16F628
for the project.

Also it's a tough road redoing everything from scratch. Adding 16F87XA and 
18FXXX support to picprg2.3 is on my copious to do list. But since the
software is well tested with 16F87X and 16F62X parts, you can start from
a working base instead of having to build one from scratch. My LVP and HVP
programmers and the sofware can be found at http://www.finitesite.com/d3jsys

Good Luck,

BAJ

gnupic@linuxhacker.org