⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jan axelson's parallel port faq.htm

📁 Parallel Port description of the communication port
💻 HTM
📖 第 1 页 / 共 5 页
字号:
      do I read a logic "1" with a logic probe at these pins on the DB25 
      connector? </I></P>
      <P>A: This just means that the inputs have pull-up resistors. Not unusual, 
      and not a problem. </P>
      <P><I>Q: Is the parallel port based on the 8255 Programmable Peripheral 
      Interface? </I></P>
      <P>A: There's no relation between the 8255 chip and the parallel port. The 
      original IBM PC did contain an 8255, but it had nothing to do with the 
      parallel-port circuits, which used ordinary logic gates and latches. </P>
      <P><EM>Q: We have a device that sends data to a line printer. We'd like to 
      send the data to a PC instead. How can we do this?</EM></P>
      <P>A: The easiest solution is to buy a parallel-to-serial converter and 
      read the data at the new PC's serial port. Converters are available from B 
      &amp;B, Jameco, JDR, and other sources. Be sure the converter can convert 
      parallel input to serial output.</P>
      <P><I>Q: I am in need of a parallel to serial to parallel conversion for a 
      data acquisition application. The data acquisition is controlled through a 
      centronics parallel port. The application requires a wireless connection 
      between the DAQ and conputer and this is to be accomplished using 19.2kbps 
      wireless modems that is RS-232 connected. Commercially available products 
      seem only to provide conversions one way OR the other based on dip switch 
      settings. Is there something availalbe that I have missed which is smart 
      enough to know what direction to convert on the fly? The data acquisition 
      system interprets the control and data lines and drives the status lines, 
      is it possible to split the signals and then rejoin them? </I></P>
      <P>A: The Centronics-to-RS-232 converters that I've seen are for use only 
      with a conventional Centronics interface - in other words, they convert 
      the 8 Data bits only, either converting parallel inputs to serial outputs, 
      or a serial input to parallel outputs. Your data-acquisition unit is 
      sending data on the Status lines (probably 4 data bits and a strobe), and 
      the converters can't handle this arrangement. One solution would be to 
      program a microcontroller to do the conversions between the modem and 
      data-acquisition device. Or (if possible) switch to a data-acquistion unit 
      with a serial interface. </P>
      <P><I>Q: I'd like to power a low component count device via an output port 
      bit on the pc's parallel port. Does anyone know the current sourcing spec 
      for an output port bit? </I></P>
      <P>A: The data outputs on the original parallel port were 74LS374 outputs, 
      which can source 2.6 milliamps at 2.4 guaranteed, 3.1V typical. The data 
      outputs on most parallel ports are at least as strong as the original 
      port's, but no guarantees. If you need 5V, you can use one of the 
      high-efficiency step-up regulators from Maxim &amp; others (Max756). The 
      newer port controller chips often have IEEE-1284 Level 2 outputs, which 
      can source 12 milliamps at 2.5V. The Control outputs were originally 
      open-collector TTL with 4.7K pullups, so these are less useful as current 
      sources. </P>
      <H2>Speed</H2>
      <P><I>Q: How can Parallel Port ISA card support quoted rates of data 
      transfer in excess of 1MB/sec ? As far a I know every in/out command for 
      an ISA bus address takes at least 1 microsecond to perform REGARDLESS of 
      processor speed ? </I></P>
      <P>A: A simple parallel-port read or write does take one ISA-bus cycle, 
      and on most systems, the bus speed is around 1.3 Mhz, so one cycle is a 
      little under 1 microsecond. A complete data transfer on the original 
      parallel port usually takes at least 4 cycles, however: check the Busy 
      status, write the data, bring Strobe low, then high. On ports that support 
      EPP and ECP modes, in these modes the port hardware does the handshake, 
      and a complete transfer can take place in 1 bus cycle. </P>
      <P>There are at least two ways of getting faster data transfers: Some 
      ports support a "fast mode" that uses the ISA bus's NOWS (no wait state) 
      signal to cause the CPU to skip 3 wait states. This mode is twice as fast, 
      or around 2.7 Mhz. ECPs also include hardware support for data 
      decompressing (&amp; sometimes compressing, though that's often left for 
      software), so the effective rate of data transmission can be much faster 
      than the number of bytes written or read per second. Also, ECPs may be 
      able to transfer data between the host's and peripheral's ECP buffers at 
      rates greater than 1 Mhz, though the buffers are typically just 8 bytes. 
      </P>
      <H2>Using Interrupts </H2>
      <P><I>Q: I'm confused about printer ports and IRQs. I've been told several 
      contradictory things. I've been told that device drivers for don't 
      actually use interrupts, so you can set multi-port cards such as 
      byterunner's 4 serial/3 parallel port card to either all use the same IRQ 
      for the parallel ports or none at all and everything should work. I've 
      also been told that every printer port must absolutely use separate IRQ's. 
      </I></P>
      <P>A: You can print from DOS, Windows 3.1, and Windows 95/98 without using 
      parallel-port interrrupts. It's easy enough to test: select no IRQ level 
      on your port, then print to it. But - there are situations where you might 
      need or want to use parallel port interrupts: </P>
      <P>1. Under Windows 95/98, if your PC's port and your printer both support 
      ECP transfers, W95 will print using ECP mode (faster) if ECP mode is 
      enabled at the port (for motherboard ports, in the CMOS setup), if the 
      PC's port is identified as ECP in the Device Manager, and if the port has 
      an assigned interrupt and DMA channel (see Control Panel, System, Device 
      Manager, Resources). </P>
      <P>2. Drivers for other parallel-port devices (drives, scanners, etc.) may 
      use interrupts, or they may work better (faster) with interrupts. </P>
      <P>3. Some alternate print spoolers can use interrupts. LaserTools' 
      PrintCache was one, though I haven't seen recent versions. </P>
      <H2>Bidirectional Ports </H2>
      <P><I>Q: I am trying to obtain the status of 8 switches via the parallel 
      port. What I need is I think first a way to tell if I can tri-state the 
      data-port lines port on my computer, so that I can read external signals 
      on the data lines. Does anyone know how to tell if the port will support 
      setting Control Port bit 5 to tristate the outputs? </I></P>
      <P>A: To find out if the data port is bidirectional: 1. Set bit 5 of the 
      control register (at base address+2). 2. With nothing connected to the 
      port, write a couple of values to the data port, and read each back after 
      you write it. If the reads DON'T match the writes, your port is probably 
      bidirectional. Setting C5 disabled the data outputs and you're reading the 
      open inputs of the data-port buffer. If the reads DO match the writes, 
      your port isn't bidirectional. The data outputs are still enabled, you're 
      reading back what you wrote, and you won't be able to read external 
      signals. </P>
      <P>On many ports, before you can use the data lines for input, you have to 
      configure the port for "PS/2 mode", usually in the CMOS setup or a 
      software utility. This writes to configuration registers in the chip that 
      controls the port. The specifics of how to access the registers vary with 
      the chip, so it's impossible to give a single programming procedure that 
      will work for all. Some parallel ports (usually on expansion boards) have 
      configuration jumpers on the circuit board to set the mode. (Check your 
      board's documentation.) If the port is configured as ECP, select the PS/2 
      mode in the ECP's ECR (as described below).</P>
      <P><I>Q: I've been searching for info on enabling PS/2, or Byte Mode, as 
      described in the IEEE 1284 specification for all the different chips and 
      boards. They all make the mode possible but the procedure is different for 
      each chip and even for each board brand implementation! </I></P>
      <P>A: If you've created a product that connects to the parallel port, and 
      you have software capable of using Byte ("PS/2") mode, or another of the 
      new modes with your device, you could do the following: </P>
      <P>1. Ask users to enable the new modes at their port. It's just about 
      impossible to do this automatically, because there's no way to detect 
      which port-controller chip is used. If the controller chip is on the 
      motherboard, there's normally a parallel-port option in the CMOS setup. If 
      the port is on an expansion card, there should be jumpers or configuration 
      software that came with the board. On some boards, the new modes are 
      hard-wired-enabled, so nothing needs to be done. (The user shouldn't have 
      to select a specific mode, just configure the port so that the advanced 
      modes are available. ) Example: some (or all) Dell XPS P90 motherboard 
      parallel ports allow selecting AT or PS/2 type port. The AT option locks 
      out everything except "original" Centronics-type output. The PS/2 option 
      puts the port in the controller's ECP configuration, with the PS/2 submode 
      selected, so all of the other modes except EPP are available via the ECP's 
      ECR register. The documentation doesn't explain this; the only way to 
      determine it is to select the different options and examine the contents 
      of the configuration registers. To use EPP mode, you do have to access the 
      configuration registers. </P>
      <P>2. Once the new modes are enabled, your software can try out the 
      different modes and use the best of the available options. </P>
      <P><EM>Q: I am trying to interface a device to a parallel port, using PS/2 
      mode (simple bidirectional) and reading data on the parallel port&#8217;s Data 
      lines. I have successfully used this device on older AST 386 notebook 
      ports as well as a modified SPP in a desktop computer. When in the PS/2 
      input mode, the input impedance of the older computers is fairly high, as 
      I would expect if the output latch is truly tri-stated.</EM></P>
      <P><EM>The problem I am chasing is with a new Toshiba 420 notebook 
      computer, which professes to have a port which can be configured as a 
      standard bi-directional or an ECP. After I have configured (through setup) 
      the Toshiba port for bidirectional, when I switch from the compatibility 
      mode to the byte (PS/2) mode by writing 2Xh to the port&#8217;s Control 
      register, each data pin is pulled up rather strongly to +5 vdc. It 
      requires less than 270 ohms from any data pin to ground (sinking about 4 
      ma) to be able to read a 0 at the data register. This is certainly not my 
      idea of "tri-state".</EM></P>
      <P><EM>Have you ever dealt with such a port and would you believe this 
      could be normal operation?</EM></P>
      <P>A: Several people have described this problem to me, always with 
      Toshiba laptops. One possibility is that the Data lines have pullup 
      resistors. The IEEE-1284 standard actually recommends using 1.2K pullups 
      on inputs, "to ensure operation with Level 1 [original] and compatible 
      devices." And an input with a 1.2K pullup would require a driver capable 
      of sinking several milliamperes.</P>
      <H2>Using EPP &amp; ECP </H2>
      <P><I>Q: Does the ECP parallel port specification require the use of a DMA 
      channel? </I></P>
      <P>A: No, but a specific device driver may make use of it if available. 
      For example, if your PC and printer both support ECP mode, but your 
      printer's port has no DMA channel assigned, the Windows 95 printer driver 
      will use Fast Centronics mode instead of ECP. This is faster than SPP 
      (original) mode, but not as fast as ECP mode. </P>
      <P><I>Q: All the I/O cards I've seen require you to select a DMA channel 
      when you jumper the parallel port in ECP mode. Yet, you can set up the 
      "ECP Port" in Win95 with or without any DMA channel (and with or without 
      any IRQ, for that matter). So, if I set up the parallel port on my I/O 
      card to ECP mode with a DMA channel, but set up the "ECP Port" option in 
      Win95 NOT to use any DMA channel, can I still use that DMA channel for 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -