[Linux-parport] Re: Please help with ppdev parallel signals

Thiago Augusto Miranda Delatorre tdlt at cecm.usp.br
Wed Sep 15 19:13:59 EDT 2004


Are you using a SiS chipset based system? If so you will not be the
first having problems with the voltage stability on the data pins. The
problem appear to be only in the data pins, at least for me.
I was building an external latch, but I need more time...
If you make some progress, please tell me.

HINT: try to set a data pin inside an infinite loop...

On Tue, Sep 14, 2004 at 06:32:39PM -0400, Robert Heller wrote:
>   "Alvarado Rodriguez, Melvin J" <melvin.j.alvarado.rodriguez at intel.com>,
>   In a message on Tue, 14 Sep 2004 09:06:03 -0600, wrote :
> 
> "RMJ> Hi Robert,
> "RMJ> 
> "RMJ> I used the examples on the document "The Linux 2.4 Parport Subsystem",
> "RMJ> and no errors were found when I compiled or executed it, but when I
> "RMJ> verified the parallel signals with a Logic Analizer, no one changed. 
> "RMJ> I don't know what happened, could you please help me?
> 
> I know *very little* about the The Linux 2.4 Parport Subsystem. You
> really should post a message to the linux-parport at lists.infradead.org
> mailing list.
> 
> "RMJ> 
> "RMJ> I am using Debian with kernel 2.6.0, and the code:
> 
> Well, for starters I would guess that documentation for a 2.4 kernel
> subsystem might not be totally useful with a 2.6 kernel, but I don't
> really know that much about parallel port programming.
> 
> "RMJ> 
> "RMJ> ------------------------------------------------------------------------
> "RMJ> ---
> "RMJ> #include <sys/ioctl.h>
> "RMJ> #include <sys/types.h>
> "RMJ> #include <sys/ioctl.h>
> "RMJ> #include <stdio.h>    
> "RMJ> #include <unistd.h>
> "RMJ> #include <fcntl.h> 
> "RMJ> #include <errno.h> 
> "RMJ> #include <getopt.h>
> "RMJ> 
> "RMJ> #include "/usr/include/linux/ppdev.h"
> "RMJ> #include "/usr/include/linux/parport.h"
> "RMJ> 
> "RMJ> #include "driver.h"
> "RMJ> 
> "RMJ> 
> "RMJ> ssize_t write_printer (int fd, const void *ptr, size_t count) {
> "RMJ>   return write (fd, ptr, count);
> "RMJ> }
> "RMJ>   
> "RMJ> 
> "RMJ> int drive_printer (const char *name) {
> "RMJ>   int fd;
> "RMJ>   int mode;
> "RMJ>   
> "RMJ> 
> "RMJ>   fd = open (name, O_RDWR);
> "RMJ>   if (fd == -1) {
> "RMJ>     perror ("open");
> "RMJ>     printf("Error: Can not open %s\n",name);
> "RMJ>     return 1;
> "RMJ>   }
> "RMJ> 
> "RMJ>  if (ioctl (fd, PPCLAIM)) {
> "RMJ>     perror ("PPCLAIM");
> "RMJ>     close (fd);
> "RMJ>     return 1;
> "RMJ>   }
> "RMJ>   
> "RMJ>   for (;;) {
> "RMJ>     char buffer[1000];
> "RMJ>     char *ptr = buffer;
> "RMJ>     size_t got;
> "RMJ>     got = read (0 /* stdin */, buffer, 1000);
> "RMJ>     
> "RMJ>     if (got < 0) {
> "RMJ>       perror ("read");
> "RMJ>       close (fd);
> "RMJ>       return 1;
> "RMJ>     }
> "RMJ>     
> "RMJ>     if (got == 0)
> "RMJ>       /* End of input */
> "RMJ>       break;
> "RMJ>     while (got > 0) {
> "RMJ>       int written = write_printer (fd, ptr, got);
> "RMJ>       if (written < 0) {
> "RMJ>         perror ("write");
> "RMJ>         close (fd);
> "RMJ>         return 1;
> "RMJ>       }
> "RMJ>     
> "RMJ>     ptr += written;
> "RMJ>     got -= written;
> "RMJ>     }
> "RMJ>   
> "RMJ>   }   
> "RMJ> 
> "RMJ> }
> "RMJ> 
> "RMJ> 
> "RMJ> ______________________
> "RMJ> 
> "RMJ> Melvin J. Alvarado R.
> "RMJ> 
> "RMJ> Intel Costa Rica - FA
> "RMJ> ext 67288
> "RMJ> Office: 298-7288
> "RMJ> 
> "RMJ>                                                     
> 
>                                      \/
> Robert Heller                        ||InterNet:   heller at cs.umass.edu
> http://vis-www.cs.umass.edu/~heller  ||            heller at deepsoft.com
> http://www.deepsoft.com              /\FidoNet:    1:321/153
> 
> 
> 
> 
> 
> 
>                                                                                                                 
> 
> _______________________________________________
> Linux-parport mailing list
> Linux-parport at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-parport

-- 
Thiago A. M. Delatorre



More information about the Linux-parport mailing list