?? interfacing the extended capabilities port.htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0038)http://www.beyondlogic.org/ecp/ecp.htm -->
<HTML><HEAD><TITLE>Interfacing the Extended Capabilities Parallel Port</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META
content="Describes interfacing the ECP (Extended Capabilities Port), complete with register details and waveforms."
name=description>
<META
content="Parallel Port, Printer Port, IEEE 1284, ECP, Extended Capabilities Port"
name=keywords>
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY leftMargin=0
background="Interfacing the Extended Capabilities Port.files/bgyellow.gif"
topMargin=0 FACE="ARIAL" BASEFONT marginwidth="0" marginheight="0">
<STYLE type=text/css>#TITLEBLOCK {
COLOR: #ffffff; TEXT-DECORATION: none
}
TD {
FONT-FAMILY: Arial
}
P {
FONT-FAMILY: Arial
}
FONT {
FONT-FAMILY: Arial
}
</STYLE>
<BR>
<CENTER>
<TABLE width="95%" BOARDER="0">
<TBODY>
<TR>
<TD width="25%">
<CENTER><A href="http://www.beyondlogic.org/"><IMG alt="Beyond Logic"
src="Interfacing the Extended Capabilities Port.files/beyondsmall.gif"
border=0></A></CENTER></TD>
<TD width="50%">
<CENTER>
<SCRIPT type=text/javascript><!--google_ad_client = "pub-7725444460812017";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel ="";google_color_border = "0033FF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_url = "008000";google_color_text = "000000";//--></SCRIPT>
<SCRIPT src="Interfacing the Extended Capabilities Port.files/show_ads.js"
type=text/javascript></SCRIPT>
<NOSCRIPT><FONT color=red>This page is optimised with JavaScript 1.2.
Currently your browser has JavaScript switched off.</NOSCRIPT>
</CENTER></FONT></TD>
<TD vAlign=center align=right><BR><FONT face=ARIAL>
<SCRIPT language=javascript
src="Interfacing the Extended Capabilities Port.files/beyondmenu_plain.js"></SCRIPT>
<NOSCRIPT></FONT></TD></TR></TBODY></TABLE></CENTER></NOSCRIPT>
<CENTER>
<TABLE width="95%">
<TBODY>
<TR>
<TD><BR>
<CENTER><FONT color=green size=5>Interfacing the Extended Capabilities
Port</FONT></CENTER>
<CENTER><BR><B><FONT size=+2>Table of Contents</FONT></B></CENTER><BR>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#1">Introduction to
the Extended Capabilities Port</A></CENTER>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#2">ECP Hardware
Properties</A></CENTER>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#3">The ECP
Handshake</A></CENTER>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#4">ECP Forward
Data Cycle</A></CENTER>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#5">ECP Forward
Command Cycle</A></CENTER>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#6">ECP Reverse
Data Cycle</A></CENTER>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#7">ECP Reverse
Command Cycle</A></CENTER>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#13">ECP Handshake
vs SPP Handshake</A></CENTER>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#8">RLE - Run
Length Encoding</A></CENTER>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#9">ECP Software
Registers</A></CENTER>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#10">ECP's Extended
Control Register (ECR)</A></CENTER>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#11">ECP's
Configuration Register A (cnfgA)</A></CENTER>
<CENTER><A href="http://www.beyondlogic.org/ecp/ecp.htm#12">ECP's
Configuration Register B (cnfgB)</A></CENTER><BR><BR><A name=1><I><FONT
size=+2>Introduction to the Extended Capabilities Port</FONT></I></A>
<HR>
<UL>
<P>The Extended Capabilities Mode was designed by Hewlett Packard and
Microsoft to be implemented as the <I>Extended Capabilities Port
Protocol and ISA Interface Standard</I>. This protocol uses additional
hardware to generate handshaking signals etc just like the EPP mode,
thus runs at very much the same speed than the EPP mode. This mode,
however may work better under Windows as it can use DMA channels to move
it's data about. It also uses a FIFO buffer for the sending and/or
receiving of data. </P>
<P>Another feature of ECP is a real time data compression. It uses Run
Length Encoding (RLE) to achieve data compression ratio's up to 64:1.
This comes is useful with devices such as Scanners and Printers where a
good part of the data is long strings which are repetitive. </P>
<P>The Extended Capabilities Port supports a method of channel
addressing. This is not intended to be used to daisy chain devices up
but rather to address multiple devices within one device. Such an
example is many fax machines on the market today which may contain a
Parallel Port to interface it to your computer. The fax machine can be
split up into separate devices such as the scanner, modem/Fax and
printer, where each part can be addresses separately, even if the other
devices cannot accept data due to full buffers. </P></UL><A
name=2><I><FONT size=+2>ECP Hardware Properties</FONT></I></A>
<HR>
<UL>
<P>While Extended Capabilities Printer Ports use exactly the same D25
connector as your SPP, ECP assigns different tasks to each of the pins,
just like EPP. This means that there is also a different handshake
method when using a ECP interface. </P>
<P>The ECP is backwards compatible to the SPP and EPP. When operating in
SPP mode, the individual lines operate in exactly the same fashion than
the SPP and thus are labeled Strobe, Auto Linefeed, Init, Busy etc. When
operating in EPP mode, the pins function according to the method
described in the EPP protocol and have a different method of
Handshaking. When the port is operating in ECP mode, then the following
labels are assigned to each pin. </P>
<P>
<CENTER>
<TABLE width="90%" border=1>
<TBODY>
<TR>
<TD>
<CENTER><B>Pin</B></CENTER></TD>
<TD>
<CENTER><B>SPP Signal</B></CENTER></TD>
<TD>
<CENTER><B>ECP Signal</B></CENTER></TD>
<TD>
<CENTER><B>IN/OUT</B></CENTER></TD>
<TD>
<CENTER><B>Function</B></CENTER></TD></TR>
<TR>
<TD>
<CENTER>1</CENTER></TD>
<TD>
<CENTER>Strobe</CENTER></TD>
<TD>
<CENTER>HostCLK</CENTER></TD>
<TD>
<CENTER>Out</CENTER></TD>
<TD>A low on this line indicates, that there is valid data at the
host. When this pin is de-asserted, the +ve clock edge should be
used to shift the data into the device.</TD></TR>
<TR>
<TD>
<CENTER>2-9</CENTER></TD>
<TD>
<CENTER>Data 0-7</CENTER></TD>
<TD>
<CENTER>Data 0-7</CENTER></TD>
<TD>
<CENTER>In/Out</CENTER></TD>
<TD>Data Bus. Bi-directional</TD></TR>
<TR>
<TD>
<CENTER>10</CENTER></TD>
<TD>
<CENTER>Ack</CENTER></TD>
<TD>
<CENTER>PeriphCLK</CENTER></TD>
<TD>
<CENTER>In</CENTER></TD>
<TD>A low on this line indicates, that there is valid data at the
Device. When this pin is de-asserted, the +ve clock edge should be
used to shift the data into the Host.</TD></TR>
<TR>
<TD>
<CENTER>11</CENTER></TD>
<TD>
<CENTER>Busy</CENTER></TD>
<TD>
<CENTER>PeriphAck</CENTER></TD>
<TD>
<CENTER>In</CENTER></TD>
<TD>When in reverse direction a HIGH indicates Data, while a LOW
indicates a Command Cycle.<BR>In forward direction, functions as
PeriphAck.</TD></TR>
<TR>
<TD>
<CENTER>12</CENTER></TD>
<TD>
<CENTER>Paper Out / End</CENTER></TD>
<TD>
<CENTER>nAckReverse</CENTER></TD>
<TD>
<CENTER>In</CENTER></TD>
<TD>When Low, Device acknowledges Reverse Request.</TD></TR>
<TR>
<TD>
<CENTER>13</CENTER></TD>
<TD>
<CENTER>Select</CENTER></TD>
<TD>
<CENTER>X-Flag</CENTER></TD>
<TD>
<CENTER>In</CENTER></TD>
<TD>Extensibility Flag</TD></TR>
<TR>
<TD>
<CENTER>14</CENTER></TD>
<TD>
<CENTER>Auto Linefeed</CENTER></TD>
<TD>
<CENTER>Host Ack</CENTER></TD>
<TD>
<CENTER>Out</CENTER></TD>
<TD>When in forward direction a HIGH indicates Data, while a LOW
indicates a Command Cycle.<BR>In reverse direction, functions as
HostAck.</TD></TR>
<TR>
<TD>
<CENTER>15</CENTER></TD>
<TD>
<CENTER>Error / Fault</CENTER></TD>
<TD>
<CENTER>PeriphRequest</CENTER></TD>
<TD>
<CENTER>In</CENTER></TD>
<TD>A LOW set by the device indicates reverse data is
available</TD></TR>
<TR>
<TD>
<CENTER>16</CENTER></TD>
<TD>
<CENTER>Initialize</CENTER></TD>
<TD>
<CENTER>nReverseRequest</CENTER></TD>
<TD>
<CENTER>Out</CENTER></TD>
<TD>A LOW indicates data is in reverse direction</TD></TR>
<TR>
<TD>
<CENTER>17</CENTER></TD>
<TD>
<CENTER>Select Printer</CENTER></TD>
<TD>
<CENTER>1284 Active</CENTER></TD>
<TD>
<CENTER>Out</CENTER></TD>
<TD>A HIGH indicates Host is in 1284 Transfer Mode. Taken low to
terminate.</TD></TR>
<TR>
<TD>
<CENTER>18-25</CENTER></TD>
<TD>
<CENTER>Ground</CENTER></TD>
<TD>
<CENTER>Ground</CENTER></TD>
<TD>
<CENTER>GND</CENTER></TD>
<TD>Ground</TD></TR></TBODY></TABLE><FONT size=-1>Table 1. Pin
Assignments For Extended Capabilities Parallel Port
Connector.</FONT></CENTER>
<P></P>
<P>The HostAck and PeriphAck lines indicate whether the signals on the
data line are data or a command. If these lines are high then data is
placed on the data lines (Pins 2-7). If a command cycle is taking place
then the appropriate line will be low, ie if the host is sending a
command, then HostAck will be low or if the device/peripheral is sending
a command the PeriphAck line will be low. </P>
<P>A command cycle can be one of two things, either a RLE count or an
address. This is determined by the bit 7 (MSB) of the data lines, ie Pin
9. If bit 7 is a 0, then the rest of the data (bits 0-6) is a run length
count which is used with the data compression scheme. However if bit 7
is a 1, then the data present on bits 0 to 6 is a channel address. With
one bit missing this can only be a value from 0 to 127(DEC). </P></UL><A
name=3><I><FONT size=+2>The ECP Handshake</FONT></I></A>
<HR>
<UL>
<P>The ECP handshake is different to the SPP handshake. The most obvious
difference is that ECP has the ability at anytime to transmit data in
any direction, thus additional signaling is required. Below is the ECP
handshake for both the Forward and Reverse Directions. </P><A
name=4><I><FONT size=+2>ECP Forward Data Cycle</FONT></I></A>
<HR>
<BR>
<CENTER>
<TABLE border=0>
<TBODY>
<TR>
<TD><IMG alt="Enhanced Capabilities Port Forward Data Cycle"
src="Interfacing the Extended Capabilities Port.files/ecpfdata.gif"
border=0> <BR>
<CENTER><FONT size=-1>Figure 1. Enhanced Capabilities Port Forward
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -