gnupic: Programming the 16f870


Previous by date: 21 Dec 2001 12:22:28 -0000 Programming the 16f870, Bas Wijnen
Next by date: 21 Dec 2001 12:22:28 -0000 Re: Programming the 16f870, Byron A Jeff
Previous in thread: 21 Dec 2001 12:22:28 -0000 Programming the 16f870, Bas Wijnen
Next in thread: 21 Dec 2001 12:22:28 -0000 Re: Programming the 16f870, Byron A Jeff

Subject: Re: Programming the 16f870
From: Ralf Forsberg ####@####.####
Date: 21 Dec 2001 12:22:28 -0000
Message-Id: <20011221122040.GA591@home.se>

On Fri, Dec 21, 2001 at 12:54:09PM +0100, Bas Wijnen wrote:
> 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).

It's easy to use ppdev. Here's an example with no error checking:

 fd = open("/dev/parport0", O_RDWR);
 ioctl(fd,PPCLAIM);

 data = 0x05;
 ioctl (fd, PPWDATA, &data);

 ioctl (fd, PPRSTATUS, &data);
 printf("status = %d\n",data);

You can look at paraface in gpsim/modules, for another example.

 / Ralf


Previous by date: 21 Dec 2001 12:22:28 -0000 Programming the 16f870, Bas Wijnen
Next by date: 21 Dec 2001 12:22:28 -0000 Re: Programming the 16f870, Byron A Jeff
Previous in thread: 21 Dec 2001 12:22:28 -0000 Programming the 16f870, Bas Wijnen
Next in thread: 21 Dec 2001 12:22:28 -0000 Re: Programming the 16f870, Byron A Jeff


Powered by ezmlm-browse 0.20.