Re: Programming for Serial vs. USB

From: Hans-Bernhard Broeker (broeker_at_physik.rwth-aachen.de)
Date: 02/04/04


Date: 4 Feb 2004 18:04:12 GMT


[Note: Missing cut-down of F'up2 done...]

In comp.unix.programmer Justin Robbs <justin_robbsNO@spamhotmail.com> wrote:

> We have a point of sale system that communicates to a number of
> serial devices (upc scanner, cash drawer, customer display, credit
> card/check reader, etc.). Currently, we are using a digiboard 8
> port serial board to communicate to those devices. We access them
> as /dev/tty2a...h. Assuming we could get the devices with usb
> interfaces, how difficult would it be to start using a usb
> interface?

Not exceedingly difficult, but you will have to make substantial
modifications to the code. USB is quite a bit more than just a RS232
serial line on steroids. There's a whole stack of protocols that
comes with the raw hardware.

For starters, USB devices may not even necessarily have a device node
assigned to each of them. For that, there has to be a specialized
host-side driver to speak to interpret the data going over the USB
link. For USB-to-whatever port adapters, those will be part of your
Unix kernel with minimal luck, but not for more generic devices.

> weren't available with a usb interface, would it be possible
> (acceptable) to use a usb to serial adapter in the situation?

If you want to keep it simple, that may actually be the best bet you
have. Beware, though: not all USB-to-serial adapters support all the
little details of serial ports. Any requirement that goes beyond Rxd,
Txd, and the basic hardware handshake lines depends on sheer luck, it
seems.

> For the purposes of this discussion, I am assuming that the usb
> devices send/recv the data in the same format as the standard
> serial versions.

I wouldn't bet on that. Not without having accessed at least some
applicable devices' datasheets.

-- 
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.


Relevant Pages

  • usb_insert_transfer panic with if_zyd
    ... When I use my ZyXEL G-220 Wireless USB Stick with the if_zyd driver, ... <ACPI PCI bus> on pcib0 ... device problem, disabling port 1 ... <Ethernet over FireWire> on firewire0 ...
    (freebsd-current)
  • 2.6.10-rc1 & ahci & IHC6R & 925X & raid1
    ... usb modules for console, usb keyboard, network and starting a shell. ... ACPI: PM-Timer IO Port: 0x808 ... PCI: PCI BIOS revision 2.10 entry at 0xfb768, ... usbcore: registered new driver hub ...
    (Linux-Kernel)
  • Re: USB to Serial Line interface for OpenVMS Itanium/VMS 8.3
    ... USB to serial adapters can be quite "fun". ... called ftdi. ... substantial performance hit when moving from a conventional serial port (low ...
    (comp.os.vms)
  • usb does not work on vias smp mainboard
    ... I installed kernel 2.4.21 on an via's mainboard, it seems that the usb ... number of MP IRQ sources: ... PCI Interrupt Link ... Port indicators are not supported ...
    (Linux-Kernel)
  • Re: sata_nv times out for BD-ROM iHOS104-08
    ... generic IDE driver loaded? ... ACPI: PM-Timer IO Port: 0x4008 ... CPU: Physical Processor ID: 0 ... USB 2.0 'Enhanced' Host Controller Driver ...
    (Linux-Kernel)