Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

USB-to-Parallel C IO Programming

196 views
Skip to first unread message

BinaryFrost

unread,
Apr 7, 2008, 9:52:39 AM4/7/08
to
I have a USB-to-Parallel cable which successfully shows up as /dev/
usblp0 under Ubuntu:

Apr 7 14:45:50 lapfrost kernel: [ 1476.746966] usb 4-1: new full
speed USB device using uhci_hcd and address 3
Apr 7 14:45:50 lapfrost kernel: [ 1476.896270] usb 4-1: configuration
#1 chosen from 1 choice
Apr 7 14:45:50 lapfrost kernel: [ 1476.938188] usblp0: USB
Bidirectional printer dev 3 if 0 alt 0 proto 2 vid 0x4348 pid 0x5584

With standard parallel ports I can access the IO lines with inb/outb
and a base address.

How do I achieve this with the USB-to-parallel cable? Are there calls
to the usblp subsystem then I can make to get direct access to the IO
lines?

I've had a look through the kernel source, which mentions
usblp_open(), the usblp struct etc - but I'm not sure how to call
these.

Any suggestions or (even better) examples would be appreciated.

Many thanks in advance.

phil-new...@ipal.net

unread,
Apr 7, 2008, 2:59:42 PM4/7/08
to
On Mon, 7 Apr 2008 06:52:39 -0700 (PDT) BinaryFrost <binar...@gmail.com> wrote:

| I have a USB-to-Parallel cable which successfully shows up as /dev/
| usblp0 under Ubuntu:
|
| Apr 7 14:45:50 lapfrost kernel: [ 1476.746966] usb 4-1: new full
| speed USB device using uhci_hcd and address 3
| Apr 7 14:45:50 lapfrost kernel: [ 1476.896270] usb 4-1: configuration
| #1 chosen from 1 choice
| Apr 7 14:45:50 lapfrost kernel: [ 1476.938188] usblp0: USB
| Bidirectional printer dev 3 if 0 alt 0 proto 2 vid 0x4348 pid 0x5584
|
| With standard parallel ports I can access the IO lines with inb/outb
| and a base address.

How did you do inb/outb to a /dev/ based device for the original parallel
port? Or are you referring to inb/outb in the context of the parallel port
driver?


| How do I achieve this with the USB-to-parallel cable? Are there calls
| to the usblp subsystem then I can make to get direct access to the IO
| lines?
|
| I've had a look through the kernel source, which mentions
| usblp_open(), the usblp struct etc - but I'm not sure how to call
| these.
|
| Any suggestions or (even better) examples would be appreciated.

If you have done I/O to the /dev/ entry for the original parallel port,
have you tried doing things the same way for the USB based one using the
/dev/ entry you get for that?

--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-200...@ipal.net |
|------------------------------------/-------------------------------------|

Timothy Baldwin

unread,
Apr 7, 2008, 4:22:45 PM4/7/08
to
In message
<d1fb2c3f-13fb-47ab...@s37g2000prg.googlegroups.com>,
BinaryFrost <binar...@gmail.com> wrote:

> I have a USB-to-Parallel cable which successfully shows up as /dev/
> usblp0 under Ubuntu:
>
> Apr 7 14:45:50 lapfrost kernel: [ 1476.746966] usb 4-1: new full
> speed USB device using uhci_hcd and address 3
> Apr 7 14:45:50 lapfrost kernel: [ 1476.896270] usb 4-1: configuration
> #1 chosen from 1 choice
> Apr 7 14:45:50 lapfrost kernel: [ 1476.938188] usblp0: USB
> Bidirectional printer dev 3 if 0 alt 0 proto 2 vid 0x4348 pid 0x5584
>
> With standard parallel ports I can access the IO lines with inb/outb
> and a base address.

That isn't portable.

> How do I achieve this with the USB-to-parallel cable?

Many USB to parallel adapter can only use the printer protocols. You need to
use a suitable cable and driver, Linux has a driver for the Lucent
Technologies USS-720 chip.

Use the standard user mode parallel port interface, see:
http://people.redhat.com/twaugh/parport/html/x916.html

> Are there calls
> to the usblp subsystem then I can make to get direct access to the IO
> lines?

No, the concept does not exist in the USB printer protocol.

> Any suggestions or (even better) examples would be appreciated.

It will be slow, consider running (part of) the program in a microcontroller
or obtaining a PCI parallel port.


Jan Kandziora

unread,
Apr 7, 2008, 5:43:46 PM4/7/08
to
Timothy Baldwin schrieb:

>
> Many USB to parallel adapter can only use the printer protocols. You need
> to use a suitable cable and driver, Linux has a driver for the Lucent
> Technologies USS-720 chip.
>
I'd like to add it's hard to get any of these. Seems they are extinct.

Kind regards

Jan

0 new messages