gnupic: Programming the 16f870


Previous by date: 29 Dec 2001 20:32:28 -0000 Re: Programming the 16f870, Byron A Jeff
Next by date: 29 Dec 2001 20:32:28 -0000 16F627 and 16F628, Scott Dattalo
Previous in thread: 29 Dec 2001 20:32:28 -0000 Re: Programming the 16f870, Byron A Jeff
Next in thread: 29 Dec 2001 20:32:28 -0000 Re: Programming the 16f870, Rogier Wolff

Subject: Re: Programming the 16f870
From: ####@####.#### (Byron A Jeff)
Date: 29 Dec 2001 20:32:28 -0000
Message-Id: <200112292030.fBTKUVl22243@cleon.cc.gatech.edu>

> 
> On Fri, Dec 21, 2001 at 09:27:30AM -0500, Byron A Jeff wrote:
> > > 
> > > Hello,
> > > 
> > > I am trying to program a 16f870 with a home-built parallel port programmer,
> > > similar to the trivial lvp programmer from http://www.gnupic.org. The hardware
> > > works fine, I can read data with it (and recognise the chip identification).
> > 
> > Cool. Glad that it works.
> 
> It doesn't anymore, since I moved the hardware to a different computer
> (where it isn't in the way) :-( All the voltages seem allright though. I'm
> using a high voltage programmer. Does anyone know usual problems with
> programmers?

The usual are issues in cable length, and differences in parallel ports.
Checking and rechecking voltages and connections is always the best start.

> 
> > > I am using a simple program I wrote in C that sends 3 bits on the parallel 
> > > port
> > > (mclr, data and clock) and reads the data. I use a bash script to do the
> > > programming.
> > 
> > Interesting. I do have a question though: are you writing this code as a
> > learning exercise? If so then more power to you. However if the objective is
> > to get a programmer working, then I would advise pulling a copy of picprg2.3b
> > from my page and use it. It works quite well and will save you the hassle of
> > regenerating new code.
> 
> Both, actually. And I think I need to, since my hardware is like this
> trivial LVP programmer, but not equal.

The good thing about picprg2.3 is that the pin position and polarities of the
functions are programmable. So even if you have some differences, you can
configure around them.

> 
> > > The source of the picwrite program is there too. It is suid root so it can
> > > write to the port (which is really dirty, but I don't know how to use the
> > > parport drivers and didn't feel like learning it since it's just for myself
> > > anyway).
> 
> On Fri, Dec 21, 2001 at 01:20:40PM +0100, Ralf Forsberg wrote:
> > It's easy to use ppdev. Here's an example with no error checking:
> 
> I tried. It is really easy indeed. Thanks.
> 
> > Probably isn't worth the hassle not to make it SUID root. picprg2.3b needs to
> > be SUID root in order for ordinary users to user it.
> 
> That is a reason for me not to use it. I don't want any code which is not
> written by myself and replacable to be suid root.

I understand your point to a point. picprg2.3 is small enough and simple enough
that it's easily auditable. All ioport references are in lowlvl.c.

Also I think that only the ioperm call is required to be setuid. So it should
be real easy to reset the process permissions after the call.

Just some thoughts on the subject...

BAJ

Previous by date: 29 Dec 2001 20:32:28 -0000 Re: Programming the 16f870, Byron A Jeff
Next by date: 29 Dec 2001 20:32:28 -0000 16F627 and 16F628, Scott Dattalo
Previous in thread: 29 Dec 2001 20:32:28 -0000 Re: Programming the 16f870, Byron A Jeff
Next in thread: 29 Dec 2001 20:32:28 -0000 Re: Programming the 16f870, Rogier Wolff


Powered by ezmlm-browse 0.20.