在并行端口上同时发送和接收数据
如果我理解并行端口正确,从(D0到D7)同时发送数据,但它可以单独控制棒? 例如:
D0 = Input
D1 = Input
D2 = Output
...
...
...
D7 = Input
它会起作用吗? 我想做的是同时发送和接收数据。
If I understand the parallel port right, sending data from (D0 to D7) simultaneous, but that it can control the sticks individually?
example:
D0 = Input
D1 = Input
D2 = Output
...
...
...
D7 = Input
would it work?
what I want to do is to both send and receive data simultaneously.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
数据线 (D0-D7) 正在同时读取或设置。 有关双向 I/O 的各种技术,请阅读随附的文章:
标准并行端口:http://www .beyondlogic.org/spp/parallel.htm
EPP:http://www.beyondlogic.org/spp/parallel.htm Beyondlogic.org/epp/epp.htm
ECP:http://www.beyondlogic .org/ecp/ecp.htm
Data wires (D0-D7) are being read or set simultaneously. For various tecniques for bidirectional I/O read the attached articles:
Standard parallel port: http://www.beyondlogic.org/spp/parallel.htm
EPP: http://www.beyondlogic.org/epp/epp.htm
ECP: http://www.beyondlogic.org/ecp/ecp.htm
这个站点是并行端口编程的良好来源。
基本思想是您需要一个 DLL、附加组件或库来允许您访问 PC 的 I/O 端口。 对于 Windows XP 及以上版本,您需要一个特定的驱动程序来允许您执行此操作,因为操作系统不提供开箱即用的访问权限。
并行端口通常驻留在三个地址 278,378, 3BC 之一。 这个港口。 有您正在读取或写入的字节。
(base)+1 端口允许访问状态字节。 IE。 279,379, 3BD
(base)+2 端口允许访问控制字节。 IE。 27A,37A,3BE
并行端口文档不仅会告诉您如何实现常见模式(如双向),还会告诉您如何在字节级别控制端口以实现您自己的自定义。
那时只有标准模式可用。 您在(基本)端口泵出字节。 某些应用程序(例如我的应用程序)以廉价的数字 I/O 控制器的形式操纵该端口的各个位。 我们确实使用状态和控制字节作为附加输入和输出。 您可以向并行端口芯片发送命令来精确配置模式。
如今,有数百个站点提供了使用并行端口解决各种问题的示例。 我会感到惊讶的是,其中之一没有可用于您的特定应用程序的东西。
我再次推荐的这本书是《并行端口》完整版。 它讲述了您开始所需的一切。 如果您的应用程序对于该书来说太深奥,它将提供一个跳板,您可以从中找到所需的确切设置。
This site is a good source for programming the parallel port.
The basic idea is that you need a DLL, add-on or library that allows you to access the I/O Ports of the PC. For Windows XP on up you need a specific driver that will allow you do this as the OS doesn't offer access out of the box.
The Parallel port will generally reside at one of three address 278,378, 3BC. This port. have the bytes you are reading or writing.
The (base)+1 port allows access to the status bytes. IE. 279,379, 3BD
The (base)+2 port allows access to the control bytes. IE. 27A,37A,3BE
The parallel port documentation will tell not only how to implement the common modes (like bi-directional) but how to control the port at the byte level to implement your own custom.
Back in the day there was only the standard mode available. You pump out your bytes at the (base) port. Some application, like mine, manipulated individual bits of that ports as form of cheap Digital I/O Controller. We did use the status and control bytes as additional inputs and outputs. There were commands you can send to the Parallel Port chip configure the modes precisely.
Today there are are hundreds of sites with example of using the Parallel Port to solve all kinds of problems. I would be surprised that one of doesn't have something you can use for you specific application.
Again the book I recommend starting with is Parallel Port complete. It tells just about everything you need to start with. If your application is too esoteric for that book it will give a springboard from which you can find the exact setup you need.
当然,通过发送一个仅设置了所需位的数字 (2n),您将获得预期的结果。
但我不确定双向访问。 我猜想这是通过使用控制引脚和数据引脚来实现的,但这只是一个猜测。
Of course by sending a number that has just the required bit set (2n) you'd get the expected result.
I'm not sure about bidirectional access though. I guess it's achieved by using control pins along with the data pins but that's just a guess.
进行EPP或ECP的并行端口只允许D0-D7全部输入或全部输出。 否则可能会损坏您的硬件。
请参阅 http://www.nor-tech.com/solutions/dox/ieee1284_parallel_ports .pdf,第 6 页。
但是,并行端口有几条控制线,如果您只需要“其他”方向上的少量输入/输出,这些控制线可能会很有用。
Parallel ports doing EPP or ECP only allow D0-D7 to be all input or all output. Trying to do otherwise may fry your hardware.
See http://www.nor-tech.com/solutions/dox/ieee1284_parallel_ports.pdf, page 6.
However, parallel ports have several control lines that may be useful if you only need a small amount of input/output in the "other" direction.
我相信端口控制寄存器(基地址 + 2)中的第 5 位可以切换方向。 (不附硬件线)
I believe its bit 5 in the port's control register (base address + 2) that switches direction. (no hardware line attached)