开发者

How do you interface with a USB to Parallel adapter?

开发者 https://www.devze.com 2022-12-26 13:28 出处:网络
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 US

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 mana开发者_Python百科ger 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.


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.


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.


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.


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消