home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / msdos / programm / 8647 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  2.7 KB

  1. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!rpi!uwm.edu!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!ralf
  2. From: ralf+@cs.cmu.edu (Ralf Brown)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: Parallel port I/O (mostly O : -)
  5. Message-ID: <Bt9Ly4.7sD.2@cs.cmu.edu>
  6. Date: 20 Aug 92 04:32:27 GMT
  7. Article-I.D.: cs.Bt9Ly4.7sD.2
  8. References: <1992Aug19.135359.24909@bas-a.bcc.ac.uk>
  9. Sender: news@cs.cmu.edu (Usenet News System)
  10. Organization: School of Computer Science, Carnegie Mellon
  11. Lines: 38
  12. Nntp-Posting-Host: b.gp.cs.cmu.edu
  13.  
  14. In article <1992Aug19.135359.24909@bas-a.bcc.ac.uk> nino@mph.sm.ucl.ac.uk (Nino Margetic) writes:
  15. }I know that there is also a way to access the LPT port directly thru the
  16. }in/out commands and its 3 I/O registers. Are there any advantages (in
  17. }terms of speed) in using interrupt driven parralel I/O, as compared to
  18. }INT17 BIOS service as I have used it - if there is, how much, and is
  19. }it doable in C?? I can just about read assembler, but that's about it.
  20.  
  21. Writing directly to the ports can be an order of magnitude faster than doing
  22. separate interrupt calls to check the status and actually write the character.
  23. However, you probably will not be able to get reliable interrupt-driven
  24. operation because (a) a majority of parallel ports don't reliable generate
  25. the IRQ, and (b) the standard IRQ7 is also triggered whenever the interrupt
  26. controller gets an interrupt request which is deasserted before the CPU
  27. responds to the request.
  28.  
  29. }The speed of the application is crucial - I need to send as many bytes
  30. }thru the LPT port as possible (order of 1e6). N.B. does anyone know the
  31. }approximate number of bytes per second that can be sent thru the LPT port
  32. }via INT17 and/or interrupt driven parallel I/O??
  33.  
  34. Maximum speed depends on the CPU speed and the speed of the device at the
  35. other end of the parallel cable.  For example, if the other end is an
  36. Epson FX80, the timing specifications for the strobe/ACK sequence set a
  37. limit of about 75,000 characters per second.  Connecting a pair of 386/33s,
  38. a data rate of 300,000 characters per second sounds feasible using tight
  39. loops (you'd never be able to get near that speed in interrupt-driven
  40. operation due to the overhead of handling an interrupt).
  41.  
  42. I've managed to pump nearly 2400 characters per second to said FX80 using
  43. 30% of the CPU cycles on a 4.77MHz 8088 (over one-third of that 30% was
  44. the overhead of handling 2400 clock interrupts per second).  All parallel
  45. port I/O was done using direct port accesses.
  46.  
  47. -- 
  48. Internet: RALF+@CS.CMU.EDU   |The University would disclaim this if it knew...
  49. FIDO: Ralf Brown 1:129/26.1  |
  50. BIT: RALF%CS.CMU.EDU@CARNEGIE|"Success has a simple formula: do your best,
  51. AT&Tnet: (412)268-3053 school| and people may like it."   -- Sam Ewing
  52.