如何与 USB 转并行适配器连接?

发布于 2024-08-28 16:10:14 字数 247 浏览 8 评论 0原文

我目前正在做一个项目,我必须与通过计算机并行端口制作的电路进行交互。然而,我的电脑没有并行端口,所以我借了一条并行转 USB 适配器电缆。该电缆没有附带任何驱动程序,但设备管理器将其识别为 USB 部分下的“USB 打印支持”控制器。

看来旧的并行打印机可以插入并正常工作,没有任何问题。所以我的问题是,如果我用 Java 编写一个程序尝试直接与并行端口交互,它会工作吗?如果没有,任何人都可以给我一些关于我需要做什么才能与之交互的指示吗?

谢谢。

I'm currently doing a project where I have to interact with a circuit I made through the parallel port of a computer. However, my computer doesn't have a parallel port so I borrowed a Parallel to USB adapter cable. The cable didn't come with any drivers, but it's recognized by the device manager as a "USB Printing Support" controller, under the USB section.

It seems that old parallel printers can be plugged in and work properly without any problems. So my question is, if I write a program in Java that tries to interact with a parallel port directly, will it work? And if not, can anyone give me some pointers as to what I need to do to interact with it?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

Saygoodbye 2024-09-04 16:10:14

我认为您应该前往 javax.comm此处。 . 还有一个应该工作得更好的版本,称为 librxtx.. 看看这里< /a> (它是 javax.comm 的可插拔替代品)..

我将它们都用于嵌入式设备,它们工作得很好,它们管理串行并行端口。在你的情况下也许还有usb

I think you should head toward javax.comm library here.. there is also a different version that is supposed to work better, called librxtx.. take a look here (it's a pluggable replacement for javax.comm)..

I used both of them for an embedded device and they worked great, they manage serial and parallel port.. maybe also usb in your case.

谁人与我共长歌 2024-09-04 16:10:14

我不能谈论并行或 Java,但我已经通过 USB 串行和 C# 做了类似的事情。在这种情况下,它与本机控制器完全相同。 YMMV。

至于测试:买一台旧的点阵打印机(如果你真的想要细节,请将其置于十六进制转储模式)。

如果您 真的想要这个东西的驱动程序,找到一个实用程序(我认为 Windows 设备管理器可以做到),它为您提供供应商 ID 和产品 ID 号,并且从中您可以查找各种有趣的东西(许多 Linux发行版有纯文本文件,它将数字映射到制造商的名称和内容不)加上谷歌应该给你一个驱动程序安装程序。

I can't speak for parallel or Java but I've done something similar with serial-via-USB and C#. In that case it was exactly the same as a native controller. YMMV.

As for testing things: get an old dot-matrix printer (and put it in hex dump mode if you really want the nitty-gritty).

If you really want drivers for the thing, find a utility (I think the windows device manager can do it) that gives you the vendor ID and product ID numbers and from those you can look up all kinds of fun stuff (many Linux distributions have a plain text file that maps the numbers to the name of the manufacturer and what not) that plus Google should give you a driver installer.

七秒鱼° 2024-09-04 16:10:14

你需要java并行端口驱动程序,但我还没有免费找到。您需要支付 Windows 驱动程序的费用。

我想如果你使用 Linux 的话可能会有一些免费的驱动程序。

You need java parallel port drivers which I haven't found for free. You'll have to pay for the driver for Windows.

I think there might be some free drivers if you use Linux.

舂唻埖巳落 2024-09-04 16:10:14

USB“并行端口”适配器和电缆通常不是。它们包含模拟 USB 打印机的芯片,并将打印数据发送到并行端口,就像使用并行(打印机)端口发送到类似的打印机一样。

除非您拥有的设备实际上是打印机,否则可能很少有(如果有的话)适配器可以工作。

有多种方法可以将 GPIO“并行”/总线引脚连接到 USB,包括某些 FTDI 芯片、UART 和各种微控制器。如果您可以编写软件来使用其中之一,它可以让您像老式 PC 并行端口一样驱动任意电路(尽管不是通过相同的 MMIO)。

USB "parallel port" adapters and cables generally aren't. They contain chips that emulate USB printers and send the print data out the parallel port like it might be sent to a similar printer using a parallel (printer) port.

Unless the device you have is actually a printer, there are probably very few (if any) adapters that will work.

There are ways of attaching GPIO "parallel"/bus pins into USB including certain FTDI chips, UARTs and various microcontrollers. If you can write software to use one of these, it could let you drive arbitrary circuits the way olde PC parallel ports were (not through the same MMIO, though).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文