[PARPORT] Epp speed problems


chris fletcher (clfletch@nosc.mil)
Mon, 15 Nov 1999 14:50:23 -0800 (PST)


Hi all,

        I have finally successfully set up program that reads to parallel port in Epp mode, but I am disappointed in the data rates that I am receiving. The data rate that I receive on a 450MHz Pentium III Pc in EPP1.9 is between 130-140 Kbytes/sec from a device that I know can output data around 833Kbytes/sec. From literature I have read on the parallel port I have found that the port is capable of speeds up to around 2Mbytes in Epp mode.
        Is there some type of delay in ppdev or parport that will prevent the port from data transfer rates greater than 140 kbytes/sec?

        Is the driver capable of approaching the port's transfer rates ( I could live with 500 kbytes/sec) in another mode, ie ECP mode?

        If ECP mode is a better mode, I would like to see an example of how to use the DMA, fifo, etc..?

        Does my code prevent linux or the driver from attaining higher transfer speeds? I do not know if the read (fd,data,..) is the best approach.
       
         I am currently using kernel version 2.3.12 and have tried 2.2.10 and 2.2.13 with the tmw and ppdev patches
         
        After I do an insmod of ppdev.o, parport, and parport_pc, I run

        Here is a listing of the program that I run from user-space:
#include <sys/time.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <getopt.h>
#include "parport.h"
#include "ppdev.h"

int main (int argc, char *argv[])
{
  int fd;
  char hbuffer[2000];
  int ret;
  int fields = 0;
  int data;
  int compat = IEEE1284_MODE_COMPAT;
  int mode = IEEE1284_MODE_EPP;
  int i;
   
  fd = open ("/dev/parport0",O_RDONLY);
  if (fd == -1)
    {
      perror (argv[optind]);
      return fd;
    }
  if (ioctl (fd, PPCLAIM))
    {
      fprintf (stderr, "deviceid: cannot claim port\n");
      close (fd);
      return 1;
    }
 if (ioctl (fd, PPSETMODE, &mode))
    {
      fprintf (stderr, "deviceid: cannot set transfer mode\n");
      close (fd);
      return 1;
    }
  if (ioctl (fd, PPNEGOT, &mode))
    {
      fprintf (stderr, "deviceid: device not IEEE 1284 compliant\n");
      close (fd);
      return 1;
    }
  data=read(fd,hbuffer,1000);
  printf("data %d\n",data);
 for(i=0;i<1000;i++)
  printf("read data %hx\n",hbuffer[i]);
  ioctl (fd, PPNEGOT, &compat);
  ioctl (fd, PPRELEASE);
  close (fd);
  return;
 }

 
  
                                                                    
Thanks for your help
End

###############################################################

***************************************************************
end
Christopher L. Fletcher
Electrical Engineer
Space and Naval Warfare Systems Command (SPAWAR)
Systems Center San Diego (SSC-SD)
Code D857 Acoustics Branch
49575 Gate Rd
San Diego, Ca 92152-6435
619-553-3085
clfletch@spawar.navy.mil

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Mon 15 Nov 1999 - 17:55:00 EST bsp;                /*ctr |= PARPORT_CONTROL_STROBE;
         if (ioctl (fd, PPWCONTROL, &ctr)) {
                 printf ("Couldn't write control\n");
                 return 1;
         }
           ctr &= ~PARPORT_CONTROL_STROBE;
         if (ioctl (fd, PPWCONTROL, &ctr)) {
                 printf ("Couldn't write control\n");
                 return 1;
         }*/
         }
  }
  
  ioctl (fd, PPRELEASE);
  close (fd);
  return ret;
}

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Mon 15 Nov 1999 - 17:55:00 EST