Find the answer to your Linux question:
Results 1 to 2 of 2
I have several devices running off of serial and parallel ports. These were written in classic C on Slackware. I want to convert to USB but when I read about ...
  1. #1
    Linux User
    Join Date
    Mar 2008
    Posts
    287

    convert 2 USB

    I have several devices running off of serial and parallel ports. These were written in classic C on Slackware.
    I want to convert to USB but when I read about conversion I am getting confused. How do I go about sending signals to CS, CLK, & OUTREG thru the USB??
    Is there a simple straight forward explanation somewhere which deals with this without superfluous verbage? I have tried several.

  2. #2
    Linux Newbie tetsujin's Avatar
    Join Date
    Oct 2008
    Posts
    115
    USB is a somewhat different beast. There are pre-existing chipsets which will interface a USB host to a parallel port or serial port device - these require a corresponding driver on the host system.

    Linux does contain many such drivers - so for the most part it's all about finding the right one for your adaptor. From there, writing programs to use the device is mostly the same - just find the device file that corresponds to the new device and access that. (You can't, however, use direct port I/O to 0x378 or whatever... The OS would need to actively map the device to that location, and as far as I know it doesn't.)

    It's also important to note the hardware differences of USB as opposed to, say, the parallel port. Traditionally, the parallel port was implemented as a device on the system bus (PCI or ISA) and the host could read or change the status of the various lines on the port almost any time it liked. This kind of bit-banging doesn't really work with USB devices: it possibly could but with the way the USB bus is typically managed it doesn't...

    Basically the whole tree of USB devices and hubs shares bandwidth - and the whole thing is driven by the host... So devices can't notify the host when something interesting happens (like a status change on carrier detect or DSR lines) - the host has to poll the device to get that information. The frequency of this polling is limited by the speed of the USB device (often these kinds of adaptors will be 12Mbps, the "full speed" of USB 1.1) as well as the need to service other devices on the bus... If polling the device between 10 and 100 times per second is adequate, the hardware and software may be able to do that. If you need it faster than that, USB probably won't be adequate.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...