外文翻译-并行端口大全

上传人:机械****计 文档编号:548350 上传时间:2019-04-29 格式:DOC 页数:12 大小:56.50KB
返回 下载 相关 举报
外文翻译-并行端口大全_第1页
第1页 / 共12页
外文翻译-并行端口大全_第2页
第2页 / 共12页
外文翻译-并行端口大全_第3页
第3页 / 共12页
点击查看更多>>
资源描述
XX 工 学 院毕业设计(论文)外文资料翻译学 院:机械工程学院专 业:机械设计制造及其自动化姓 名:学 号:外文出处:Parallel Port Complete(用外文写)附 件:1.外文资料翻译译文;2.外文原文。指导教师评语:签名: 年 月 日注:请将该封面与附件装订成册。附件 1:外文资料翻译译文并行端口大全精英科技 那怡超中国电力出版社摘要 :并行接口,指采用并行传输方式来传输数据的接口标准。通常所说的并行接口一般称为Centronics接口,也称IEEE1284,最早由Centronics Data Computer Corporation公司在20世纪60年代中期制定。Centronics公司当初是为点阵行式打印机设计的并行接口。并口已经成为了计算机配置的标准接口之一,并口在很多领域广泛应用,成为了数据采集的通用接口。用户只需通过简单的插入操作,就可将几乎所有的外部设备连接到电脑上,并通过它来实现输入、输出或者是双向连接。打印机仍然是连接到并口上的最常见设备,但外部磁带机、磁盘驱动器、扫描仪等其他设备也得到了广泛的应用。便携式电脑可以使用基于并口的网络接口或者是游戏操纵杆,许多并口还被用于数据采集,测试和控制等特殊场合。另外,在很多需要计算机和外设之间进行通信的通用小型设备中,并口也是通信设备的首选。关键字 :并口 打印机接口 PC1 简介并行接口,指采用并行传输方式来传输数据的接口标准。并行接口的传输的位数,最常用的是8位,可通过接口一次传送8个数据位。在计算机领域最常用的并行接口是LTP接口。PC机上的标准并口一般都是一个25针的接口。在计算机领域中,接口是微处理器或CPU用来与其他组件之间进行数据交换的一组信号线。接口的典型应用是连接打印机、调制解调器、键盘、显示器等除系统存储器之外的几乎所有组件和设备。大多数计算机接口都是数字式的,也就是说,每个信号或者说位,要么是0,要么是1。并口即打印机接口,它和RS一232端口一起构成PC机通信的主要途径。在一些新型PC机中,可能还有SCSI、USB、lrDA等其他端口,但传统并口应用的广泛性和灵活性使其仍然是每台PC机中不可或缺的部分。并行接口中各位数据都是并行传送的,能一次同时输出或输入8个高低电平,代表8位二进制,如8条线的电压分别是:高、低、高、低、高、高、低、低,那就代表二进制:10101100.这些电压是可以自保持的,就是在你没有控制它变化时,它可以保持原来的电压,即所谓的寄存器锁存功能。电脑可以通过改变并口上各线上电压的高低,来达到控制外部设备的目的。随着PC机设计的快速发展,生产厂商推出了几种改进型的并口。这些新型的并口与原始设计兼容,同时加入一些主要以提高速度为目的的新功能。PC机与外围设备的速度不断提高,它们所完成的工作越来越复杂,所要交换的信息日益增加,因此,并口的速度也就日益重要。传统并口的速度对于向点阵、菊花链式打印机传送代表ASCll字符的字节而言,已经绰绰有余。但是,现在的打印机要完成在一页中用不同颜色打印出不同字体、细致的图表之类的工作,就必须从PC机得到更多的信息,PC机向打印机传送这些信息的速度越快,打印机就能越迅速地开始处理和打印结果。更快的并口还可以使用户能用便携的、以外设形式出现的设备代替传统方式下只能内置于计算机的组件。如并口磁带机或磁盘驱动器可以方便地从一个系统移至另一个系统。a.SPP 即标准并口,数据是半双工单向传输的,传输速度只有 150/S,主要功能:为并行端口提供了 8 个数据线以进行并行的字节传输,计算机能够通过数据线向打印机发送选能信号,以通知打印机准备好接收数据,打印机接收到数据后,向计算机发送一个回应信号(NACK)。b.PS/2 型 即简单双向型,对并行接口的一种早期改进方案是由 IBM 的 PS/2引入的双向数据端口,这种双向端口容许外设每次向 PC 机发送 8 位信息。现在,PS/2 型并口是指所有具有双向数据端口,但不是后面介绍的 EPP 或 ECP 模式的并行接口。8 字节模式是 PS/2 型并口可以用来实现从外设到 PC 数据传输的一个 8 位数据传输协议。c.ECP 即扩充功能并口,它是由 HP 和 microsoft 首先推出的。ECP 是双向接口,并能以 ISA 总线速度传送数据。ECP 有缓冲区,支持直接存储器访问传输和数据压缩。ECP 传输尤其适用打印机、扫描仪及其他需要进行大块数据传送的外设。d.EPP 即增强型并行接口,最早是由芯片厂商 Intel,PC 厂商 Zenith 及并行接口网络产品生产商 Xircom 研制的。它采用的是双向数据线。在 ISA 扩展总线的一个周期,也就是大约 1ms 的时间内,EPP 可以完成包括握手联络在内的一字节的数据传送。而同样完成这一工作,SPP 或 PS/2 接口则需要使用 4 个总线周期。EPP可以实现快速转向,因此它很适合用于磁盘、磁带驱动器等需要进行双向数据传输的设备。EPP 同样是模拟 SPP 的,一部分 EPP 还可以模拟 PS/2 型并口工作。e.多模式接口,很多新型接口支持多种模式,可以工作在以上提到的部分或者全部模式下,用户可以使用配置选择,使用上述各种接口形式,或者使用其中一些而禁止其他。2 并口访问PC 并口又称打印机接口,与其他通用 I/O 口性质完全一样,它由一个 25芯的 D 型接口提供 TTL 输入和输出信号。一般它有 12 个输出口和 5 个输入口可供利用,能够满足雕刻机信号的要求,即利用程序通过输出多通道数字波形实现对混合式步进电机和电源的控制,以及通过键盘信号实现操作人员与控制系统的交互。通过 windows 以及其他软件等多种方式都可以对并口进行读写,其中最直接的方法就是对并口数据寄存器的读写。进行并口通讯,就是和 I/O 端口进行通讯,无论是 windows 还是 linux,都是把 I/O 端口的地址映射到进程的内存空间,而且地址可以通过 BOIS 设置,在 linus 中可以通过 Proc 文件系统查看。访问并口,就是访问并口的各个寄存器,这样就有两种方法,一是在用户空间使用 C 函数库直接访问 I/O 端口,这是用户空间驱动;一是先写内核空间的驱动,再在用户空间通过内核空间驱动访问端口,这是内核空间驱动。写用户空间驱动还是内核空间驱动由几个因素决定。内核空间驱动由于它不可剥夺,因此速度更快;在用户空间只能按照内核规定的方式访问硬件,因此它更加安全;由于在内核中可以访问任意的地址空间,因此它可以更加灵活和方便的访问硬件。而用户空间驱动则更加容易实现,而且调试和运行更加方便,因为它一般不会导致系统的崩溃,并且不需要编译整个系统,但是往往需要特定的权限才可以访问硬件。总之,如果为了方便可以写用户空间驱动,为了效率和安全则应该写内核驱动空间。(l)寻址并口使用计算机的许多资源。每个接口都占用一个地址段,所不同的只是地址段的长度和位置。许多接口配置有IRQ(中断请求)等级,而ECP还可能分配有DMA通道。并口使用的系统资源不能与包括别的并口在内的其他系统组件所占用的资源相冲突。标准并行接口使用三个连续地址,通常是下面列出地址范围中的一个:3BCh,3BDh,3BEh378h,379h,37Ah278h,279h,27Ah其中的第一个地址是接口的基地址,也称为数据寄存器地址或简称接口地址。第二个地址为接口的状态寄存器地址,第三个则是控制寄存器地址。在早期的PC机中,并口基地址是3BCh,新型系统采用378h作为基地址。但是系统为并口保留了上述的三组地址,只要并口硬件兼容,还是可以将它配置到其中任何一个地址域。通常DOS 和Windows系统将第一个接口称为LPTI,第二个、第三个接口依次称为LPTZ 和LPT3。尽管第一个接口可以出现在任何一个地址域中,但通常它都放在378h处。(2)中断大多数并口都可以检测来自外设的中断信号。外设可以通过使用中断信号,通知PC 机它已做好了接收或发送一个字节的准备。要使用中断,首先要为并口配置中断请求优先级(IRQ) 。按照中断请求优先级惯例,LPTI 使用IRQ7,LPTZ使用IRQS。但是很多声卡使用的也是IRQS,由于系统中的空闲IRQ可能很少,有时IRQ7也被占用。一些并口容许使用上述两个优先级之外的其他 IRQ。(3)DMA通道ECP采用直接存储器访问(DMA,DirectMemoryAccess) 方式进行并口的数据传输。在DMA传输过程中,CPU可以处理其他工作,从而提高总体效率。要使用DMA方式,必须为并口配置0一3个DMA通道。(4)寻找现存接口DOS和WindowS系统可以实现查询现存接口,检查其他系统资源的功能。使用Windowsgx时,在“控制面板”中依次点击“系统” 、 “设备管理器” 、 “端口”选项,接着点开一个端口,就可以找到它的地址分配情况,如果有的话,还将给出端口的IRQ优先级和DMA通道。在windows3.1和Dos系统中,可以使用MierosoftDia,ostie(msd.exe) 定位端口,指定IRQ优先级和其他系统细节。并口在硬件上包含数据端口、状态端口和控制端口,其对应的地址为378h,379h,37灿(通常在一个并口情况下),其内部结构如图所示。图中描述了并口适配器的设计结构。在该适配器和微处理器之间使用PC总线接口进行连接。适配器的输出连接在一个25针D型连接器上。对于最近 PC而言,许多适配器都集成在主板上了,并且还有一些PC使用插入式的适配器进行连接。带有区段标记的命令译码器专门用来对地址信息进行译码。该命令译码器使用10根地址线(AOAg)、IOR*、IOW*和CONTROL 作为其输入信号,使用数据写、数据读、状态读、控制读、控制写作为其输出信号。数据位DO一D7与缓冲器1、缓冲器2、缓冲器3输出相连,同时这8个数据位也是锁存器1和锁存器2的输入驱动信号。只有当口百信号处于低电平时才可以使用这三个缓冲器,否则这三个缓冲器处于高阻状态。只有当输入端口已经准备好数据,并且输入时钟变为低电平时,锁存器才起作用,并在输入时钟的上升沿开始数据传输。除了来自适配器的输出信号外,状态端口的某数据位还可以在控制端口某一位的控制下产生中断请求。由于并行接口信号可能经过10英尺或更长的电缆传输,因此电缆的设计和电缆相连的电路可能就决定了电路的稳定性。所谓不能稳定工作的电路,要么是不完整或速度较慢,要么是只能时断时续或以不可知的方式工作。另外,电缆和物理接口一会影响数据的最高速率。附件 2:外文原文Parallel Port Complete Jan AxelsonLakeview Research Madison, WI 53704 Abstract From its origin as a simple printer interface, the personal computers parallel port has evolved into a place to plug in just about anything you might want to hook to a computer. The parallel port is popular because its versatileyou can use it for output, input, or bidirectional linksand because its availableevery PC has one. Printers are still the most common devices connected to the port, but other popular options include external tape and disk drives and scanners. Laptop computers may use a parallel-port-based network interface or joystick. For special applications, there are dozens of parallel-port devices for use in data collection, testing, and control systems. And the parallel port is the interface of choice for many one-of-a-kind and small-scale projects that require communications between a computer and an external device. In spite of its popularity, the parallel port has always been a bit of a challenge to work with. Over the years, several variations on the original ports design have emerged, yet there has been no single source of documentation that describes the port in its many variations. I wrote this book to serve as a practical, hands-on guide to all aspects of the paral- lel port. It covers both hardware and software, including how to design external circuits that connect to the port, as well as how to write programs to control and monitor the port, including both the original and improved port designs.Keywords Parallel Port printer interface PC1 Port TypesAs the design of the PC evolved, several manufacturers introduced improved ver- sions of the parallel port. The new port types are compatible with the original design, but add new abilities, mainly for increased speed.Speed is important because as computers and peripherals have gotten faster, the jobs they do have become more complicated, and the amount of information they need to exchange has increased. The original parallel port was plenty fast enough for sending bytes representing ASCII text characters to a dot-matrix or daisy-wheel printer. But modern printers need to receive much more information to print a page with multiple fonts and detailed graphics, often in color. The faster the computer can transmit the information, the faster the printer can begin pro-cessing and printing the result. A fast interface also makes it feasible to use portable, external versions of periph-erals that you would otherwise have to install inside the computer. A parallel-port tape or disk drive is easy to move from system to system, and for occasional use,such as making back-ups, you can use one unit for several systems. Because a backup may involve copying hundreds of Megabytes, the interface has to be fast to be worthwhile. This book covers the new port types in detail, but for now, here is a summary of the available types: Original (SPP) The parallel port in the original IBM PC, and any port that emulates the original ports design, is sometimes called the SPP, for standard parallel port, even though the original port had no written standard beyond the schematic diagrams and doc- umentation for the IBM PC. Other names used are AT-type or ISA-compatible.The port in the original PC was based on an existing Centronics printer interface. However, the PC introduced a few differences, which other systems have contin-ued. SPPs can transfer eight bits at once to a peripheral, using a protocol similar to that used by the original Centronics interface. The SPP doesnt have a byte-wide input port, but for PC-to-peripheral transfers, SPPs can use a Nibble mode that transfers each byte 4 bits at a time. Nibble mode is slow, but has become popular as a way to use the parallel port for input. PS/2-type (Simple Bidirectional) An early improvement to the parallel port was the bidirectional data port intro-duced on IBMs model PS/2. The bidirectional port enables a peripheral to trans- fer eight bits at once to a PC. The term PS/2-type has come to refer to any parallel port that has a bidirectional data port but doesnt support the EPP or ECP modes described below. Byte mode is an 8-bit data-transfer protocol that PS/2-type ports can use to transfer data from the peripheral to the PC.EPPThe EPP (enhanced parallel port) was originally developed by chip maker Intel, PC manufacturer Zenith, and Xircom, a maker of parallel-port networking prod-ucts. As on the PS/2-type port, the data lines are bidirectional. An EPP can read or write a byte of data in one cycle of the ISA expansion bus, or about 1 microsec-ond, including handshaking, compared to four cycles for an SPP or PS/2-type port. An EPP can switch directions quickly, so its very efficient when used with disk and tape drives and other devices that transfer data in both directions. An EPP can also emulate an SPP, and some EPPs can emulate a PS/2-type port.ECPThe ECP (extended capabilities port) was first proposed by Hewlett Packard and Microsoft. Like the EPP, the ECP is bidirectional and can transfer data at ISA-bus speeds. ECPs have buffers and support for DMA (direct memory access) transfers and data compression. ECP transfers are useful for printers, scanners, and other peripherals that transfer large blocks of data. An ECP can also emulate an SPP or PS/2-type port, and many ECPs can emulate an EPP as well. Multi-mode Ports Many newer ports are multi-mode ports that can emulate some or all of the above types. They often include configuration options that can make all of the port types available, or allow certain modes while locking out the others.2 System ResourcesThe parallel port uses a variety of the computers resources. Every port uses a range of addresses, though the number and location of addresses varies. Many ports have an assigned IRQ (interrupt request) level, and ECPs may have an assigned DMA channel. The resources assigned to a port cant conflict with those used by other system components, including other parallel ports Addressing The standard parallel port uses three contiguous addresses, usually in one of these ranges:3BCh, 3BDh, 3BEh378h, 379h, 37Ah278h, 279h, 27AhThe first address in the range is the ports base address, also called the Data regis-ter or just the port address. The second address is the ports Status register, and the third is the Control register. (See Appendix C for a review of hexadecimal num-bers.) EPPs and ECPs reserve additional addresses for each port. An EPP adds five reg-isters at base address + 3 through base address + 7, and an ECP adds three regis- ters at base address + 400h through base address + 402h. For a base address of 378h, the EPP registers are at 37Bh through 37Fh, and the ECP registers are at 778h through 77Ah. On early PCs, the parallel port had a base address of 3BCh. On newer systems, the parallel port is most often at 378h. But all three addresses are reserved for parallel ports, and if the ports hardware allows it, you can configure a port at any of the addresses. However, you normally cant have an EPP at base address 3BCh,because the added EPP registers at this address may be used by the video display. IBMs Type 3 PS/2 port also had three additional registers, at base address +3 through base address + 5, and allowed a base address of 1278h or 1378h.Most often, DOS and Windows refer to the first port in numerical order as LPT1,the second, LPT2, and the third, LPT3. So on bootup, LPT1 is most often at 378h, but it may be at any of the three addresses. LPT2, if it exists, may be at 378h or 278h, and LPT3 can only be at 278h. Various configuration techniques canchange these assignments, however, so not all systems will follow this conven- tion. LPT stands for line printer, reflecting the ports original intended use. If your ports hardware allows it, you can add a port at any unused port address in the system. Not all software will recognize these non-standard ports as LPT ports, but you can access them with software that writes directly to the port registers. Interrupts Most parallel ports are capable of detecting interrupt signals from a peripheral. The peripheral may use an interrupt to announce that its ready to receive a byte, or that it has a byte to send. To use interrupts, a parallel port must have an assigned interrupt-request level (IRQ). Conventionally, LPT1 uses IRQ7 and LPT2 uses IRQ5. But IRQ5 is used by many sound cards, and because free IRQ levels can be scarce on a system, even IRQ7 may be reserved by another device. Some ports allow choosing other IRQ levels besides these two. Many printer drivers and many other applications and drivers that access the par- allel port dont require parallel-port interrupts. If you select no IRQ level for a port, the port will still work in most cases, though sometimes not as efficiently, and you can use the IRQ level for something else. DMA Channels ECPs can use direct memory access (DMA) for data transfers at the parallel port. During the DMA transfers, the CPU is free to do other things, so DMA transfers can result in faster performance overall. In order to use DMA, the port must have an assigned DMA channel, in the range 0 to 3. Finding Existing PortsDOS and Windows include utilities for finding existing ports and examining other system resources. In Windows 95, click on Control Panel, System, Devices, Ports, and click on a port to see its assigned address and (optional) IRQ level and DMA channel. In Windows 3.1 or DOS, you can use Microsofts Diagnostic (msd.exe) to view ports, assigned IRQ levels, and other system details. Configuring The parallel port that comes with a PC will have an assigned address and possibly an IRQ level and DMA channel. Multi-mode ports may also be configured with specific modes enabled. You can change some or all of these assignments to match your needs. If youre adding a new port, you need to configure it, making sure that it doesnt conflict with existing ports and other resources. Port Options There is no standard method for configuring a port. Some ports, especially older ones, use jumper blocks or switches to select different options. Others allow con- figuring in software, using a utility provided on disk. A port on a system mother- board may have configuration options in the system setup screens (the CMOS setup) that you can access on bootup. On ports that meet Microsofts Plug and Play standard, Windows 95 can automatically assign an available port address andIRQ level to a port. Check your system or ports documentation for specifics on how to configure a port. Some ports allow a choice of just one or two of the three conventional base addresses. A few allow you to choose any uncommitted address, including non-standard ones. On some boards, the jumpers or switches are labeled, which isextremely handy when you dont have other documentation (or cant find it). If your port supports ECP transfers, assign it an IRQ level and DMA channel ifpossible. Most ECP drivers do use these, and if theyre not available, the driverwill revert to a slower mode. Because parallel-port signals may travel over cables of ten feet or more, the cables design and the circuits that interface to the cable can mean the difference between a circuit that works reliably and one that fails, if not completely andimmediately, then intermittently and unpredictably. The cable and interface canalso affect the maximum speed of data transfers.
展开阅读全文
相关资源
相关搜索

当前位置:首页 > 图纸设计 > 毕设全套


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!